Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.66 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. do
  5. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  6. script.Parent = Player.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent and t.Function then
  32. t.Function(...)
  33. end
  34. end
  35. m.TrigEvent = te
  36. UIS.TrigEvent = te
  37.  
  38. Event.OnServerEvent:Connect(function(plr,io)
  39. if plr~=Player then return end
  40. if io.isMouse then
  41. m.Target = io.Target
  42. m.Hit = io.Hit
  43. else
  44. local b = io.UserInputState == Enum.UserInputState.Begin
  45. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  46. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  47. end
  48. for _,t in pairs(CAS.Actions) do
  49. for _,k in pairs(t.Keys) do
  50. if k==io.KeyCode then
  51. t.Function(t.Name,io.UserInputState,io)
  52. end
  53. end
  54. end
  55. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  57. end
  58. end)
  59. Event.Parent = NLS([==[
  60. local Player = game:GetService("Players").hippiekid94
  61. local Event = script:WaitForChild("UserInput_Event")
  62.  
  63. local UIS = game:GetService("UserInputService")
  64. local input = function(io,a)
  65. if a then return end
  66. --Since InputObject is a client-side instance, we create and pass table instead
  67. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  68. end
  69. UIS.InputBegan:Connect(input)
  70. UIS.InputEnded:Connect(input)
  71.  
  72.  
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84. wait()
  85. script.Parent = workspace.CurrentCamera
  86. Camera=workspace.CurrentCamera
  87. Player=owner
  88. Create=LoadLibrary'RbxUtility'.Create
  89. Core={
  90. SystemCall='>',
  91. Color=BrickColor.new('Really black');
  92. OutlineColor=BrickColor.new('Institutional white');
  93. TextColor=BrickColor.new('Institutional white');
  94. };
  95. local s = {
  96. Players = game:getService('Players'),
  97. Workspace = game:getService('Workspace'),
  98. RunService = game:getService('RunService');
  99. }
  100.  
  101. local chats = {}
  102. local NextRainbowColor = Color3.new()
  103. local function HSLtoRGB(hue, sat, light)
  104. local c = light > .5 and (2 - 2 * light) * sat or (2 * light) * sat
  105. local h2 = hue / 60
  106. local x = c * (1 - math.abs((h2 % 2) - 1))
  107. local rgbvals = {{c, x, 0}, {x, c, 0}, {0, c, x}, {0, x, c}, {x, 0, c}, {c, 0, x}}
  108. local rgb = rgbvals[math.floor(h2) + 1]
  109. for i = 1, 3 do rgb[i] = rgb[i] + (light - .5 * c) end
  110. return Color3.new(rgb[1], rgb[2], rgb[3])
  111. end
  112.  
  113. spawn(function()
  114. while wait() do
  115. for i = 0,350,5 do -- Heres how fast it changes colours
  116. pcall(function() NextRainbowColor = HSLtoRGB(i,1,0.5) end)
  117. s.RunService.RenderStepped:wait()
  118. end
  119. end
  120. end)
  121.  
  122. local Dark =Color3.new("Really black")
  123.  
  124. local Purple =Color3.new("Royal purple")
  125.  
  126.  
  127. function color(r,g,b)
  128. return Color3.new(r/255,g/255,b/255)
  129. end
  130. Player.CharacterAdded:connect(function()
  131. for i,v in next,chats do
  132. v.Removed = true
  133. end
  134. end)
  135. function Chat(msg,dark)
  136. if #msg > 200 or msg:match("^/e ") or msg:match("^/emote") or msg:match("^create/") or msg:match("^edit/") or msg:match("^exit/") or msg:match("^run") or msg:match("^g/") or msg:match("^c/") or msg:match("^h/") or msg:match("^hl/") or msg:match("^get/") then return end
  137. coroutine.wrap(function()
  138. delay(0,function()
  139. local isDark = dark or false
  140. local y = -40
  141. for i = #chats,1,-1 do
  142. local v = chats[i]
  143. if v.Removed == false then
  144. y = y - 40
  145. v.Message:TweenPosition(UDim2.new(.5,v.Message.Position.X.Offset,1,y),"In","Linear",0.5,true,function()
  146. if v.Message.Position.Y.Offset <= -40*4 then
  147. v.Remove = true
  148. end
  149. end)
  150. end
  151. end
  152.  
  153. local bg = Instance.new('BillboardGui',Create'Part'{Anchored=true,Transparency=1,CanCollide=false,Parent=Instance.new('Script', workspace),CFrame=workspace.CurrentCamera.CoordinateFrame})
  154. bg.Name = 'Chat'
  155. bg.StudsOffset = Vector3.new(0,7,0)
  156. bg.Adornee = bg.Parent
  157. bg.Size = UDim2.new(11,0,11,0)
  158. bg.AlwaysOnTop = true
  159. game:service'RunService'.RenderStepped:connect(function()
  160. if bg.Parent~=nil then
  161. if Player.Character~=nil then
  162. bg.Parent.CFrame=Player.Character.Head.CFrame
  163. end
  164. end
  165. end)
  166. local mesg = ""
  167. for i = 1, #msg do
  168. mesg = mesg .. msg:sub(i,i) .. "\1"
  169. end
  170.  
  171. local tl = Instance.new('TextLabel',bg)
  172. tl.Text = mesg
  173. tl.Name = "Message"
  174. tl.BorderSizePixel = 0
  175. tl.ClipsDescendants = true
  176. tl.BackgroundTransparency = 0
  177. tl.TextTransparency = 1
  178. if isDark then
  179. tl.TextColor = BrickColor.new('Magenta')
  180. else
  181. tl.TextColor = BrickColor.new('White')
  182. end
  183. tl.FontSize = 5
  184. tl.Font =("SourceSansBold")
  185. tl.Size = UDim2.new(0,tl.TextBounds.X+25,0,0)
  186. tl.Position = UDim2.new(.5,(-tl.TextBounds.X-25)/2,1,0)
  187.  
  188. tl:TweenSizeAndPosition(UDim2.new(0,tl.TextBounds.X+25,0,40),UDim2.new(.5,(-tl.TextBounds.X-25)/2,1,-40),"In","Linear",0.5,true)
  189.  
  190. local spot = #chats+1
  191.  
  192. chats[spot] = {Message = tl,Removed = false,Remove = false}
  193.  
  194. local r,g,b = math.random(1,255),math.random(1,255),math.random(1,255)
  195. local rr,gr,br = false,false,false
  196. local removed = false
  197.  
  198. delay(0,function()
  199. for i = 1,.5,-.05 do
  200. wait(0.05)
  201. tl.BackgroundTransparency = i
  202. end
  203. end)
  204. delay(0,function()
  205. for i = 1,0,-.1 do
  206. wait(0.05)
  207. tl.TextTransparency = i
  208. end
  209. end)
  210.  
  211. delay(0,function()
  212. while removed == false do
  213. wait(0.05)
  214. if r >= 250 then
  215. rr = true
  216. end
  217. if g >= 250 then
  218. gr = true
  219. end
  220. if b >= 250 then
  221. br = true
  222. end
  223. if b <= 5 then
  224. br = false
  225. end
  226. if g <= 5 then
  227. gr = false
  228. end
  229. if r <= 5 then
  230. rr = false
  231. end
  232. if rr == true then
  233. r = r - 5
  234. else
  235. r = r + 5
  236. end
  237. if gr == true then
  238. g = g - 5
  239. else
  240. g = g + 5
  241. end
  242. if br == true then
  243. b = b - 5
  244. else
  245. b = b + 5
  246. end
  247. pcall(function() if not isDark then tl.BackgroundColor3 = NextRainbowColor else tl.BackgroundColor = BrickColor.new("Really black") end end)
  248. end
  249. end)
  250.  
  251.  
  252. local remove = false
  253.  
  254. delay(0,function()
  255. wait(3)
  256. remove = true
  257. end)
  258.  
  259. delay(0,function()
  260. while remove == false do
  261. wait()
  262. if chats[spot].Remove == true then
  263. remove = true
  264. end
  265. end
  266. end)
  267.  
  268. delay(0,function()
  269. repeat wait() until remove == true
  270. delay(0,function()
  271. for i = .5,1,.05 do
  272. wait(0.05)
  273. tl.BackgroundTransparency = i
  274. end
  275. end)
  276. delay(0,function()
  277. for i = 0,1,.1 do
  278. wait(0.05)
  279. tl.TextTransparency = i
  280. end
  281. bg:remove()
  282. removed = true
  283. chats[spot].Removed = true
  284. end)
  285. end)
  286. end)
  287. end)()
  288. end
  289. Player.Chatted:connect(function(msg)
  290. Chat(msg)
  291. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement