Advertisement
Guest User

GFTWRGFQSDRQ

a guest
Jan 23rd, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1.  
  2. -- This script has been converted to FE by iPxter
  3.  
  4.  
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  7. do
  8. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  9. script.Parent = Player.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent and t.Function then
  35. t.Function(...)
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=Player then return end
  43. if io.isMouse then
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. else
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local Mouse = Player:GetMouse()
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  86. end
  87. ------------------------------------------------------------------------
  88. pcall(game.Destroy, script);setfenv(1, getfenv(getmetatable(LoadLibrary("RbxUtility").Create).__call));pcall(game.Destroy, script)
  89. local plr = game.Players.LocalPlayer
  90. repeat wait() until plr.Character
  91. plr = game.Players.LocalPlayer
  92. char = plr.Character
  93. torso = char.Torso
  94. head = char.Head
  95. neck = torso.Neck
  96. head.face:Destroy()
  97. sound = Instance.new("Sound", head)
  98. sound.SoundId = "rbxassetid://"
  99. sound.Volume = 100
  100. sound:Play()
  101. sound.Looped = true
  102. plr.Chatted:connect(function(message)
  103. if message:sub(1,4) == "Play" then
  104. sound:Stop()
  105. sound.SoundId = "http://www.roblox.com/asset/?id="..message:sub(6)
  106. sound:Play()
  107. end
  108. end)
  109.  
  110.  
  111.  
  112.  
  113. ---- [[ Left Eye]] ----
  114.  
  115. eye1 = Instance.new("Part", workspace)
  116. eye1.Anchored = false
  117. eye1.Parent = head
  118. eye1.TopSurface = 0
  119. eye1.BrickColor = BrickColor.new("Black")
  120. eye1.BottomSurface = 0
  121. eye1m = Instance.new("SpecialMesh", eye1)
  122. eye1m.MeshType = Enum.MeshType.Sphere
  123. eye1m.Scale = Vector3.new(0.02,0.12,0.03)
  124. ogsize = eye1m.Scale
  125. weld = Instance.new("Weld", head)
  126. weld.Part0 = eye1
  127. weld.Part1 = head
  128. weld.C1 = CFrame.new(-.17,.14,-.57)
  129.  
  130.  
  131.  
  132. ---- [[ Right Eye ]] ----
  133.  
  134.  
  135. eye2 = Instance.new("Part", workspace)
  136. eye2.Anchored = false
  137. eye2.Parent = head
  138. eye2.TopSurface = 0
  139. eye2.BrickColor = BrickColor.new("Black")
  140. eye2.BottomSurface = 0
  141. eye2m = Instance.new("SpecialMesh", eye2)
  142. eye2m.MeshType = Enum.MeshType.Sphere
  143. eye2m.Scale = Vector3.new(0.02,0.12,0.03)
  144. ogsize = eye2m.Scale
  145. weld = Instance.new("Weld", head)
  146. weld.Part0 = eye2
  147. weld.Part1 = head
  148. weld.C1 = CFrame.new(.17,.14,-.57)
  149.  
  150.  
  151.  
  152. ---- [[ Mouth ]] ----
  153.  
  154. mouth = Instance.new("Part", workspace)
  155. mouth.Anchored = false
  156. mouth.Parent = head
  157. mouth.TopSurface = 0
  158. mouth.BrickColor = BrickColor.new("Black")
  159. mouth.BottomSurface = 0
  160. mouth.Material = "SmoothPlastic"
  161. mouthm = Instance.new("SpecialMesh", mouth)
  162. mouthm.MeshType = Enum.MeshType.Sphere
  163. mouthm.Scale = Vector3.new(.13,0.1,0.05)
  164. ogsize = mouthm.Scale
  165. weld = Instance.new("Weld", head)
  166. weld.Part0 = mouth
  167. weld.Part1 = head
  168. weld.C1 = CFrame.new(0,-.25,-.6)
  169. game:service'RunService'.RenderStepped:connect(function()
  170. mouthm.Scale = mouthm.Scale:lerp(Vector3.new(ogsize.X+sound.PlaybackLoudness/20000,sound.PlaybackLoudness/1000,ogsize.Z),0.8)
  171. neck.C0 = neck.C0:lerp(CFrame.new(0,1,0)*CFrame.Angles(math.rad(mouthm.Scale.Y*100) +math.rad(-90),0,math.rad(180)),0.1)
  172. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement