XxmadmaxgamexX

Untitled

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