Advertisement
Zach_rookie_editor3

Singing me

Nov 1st, 2019
1,632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Use h/ Buster ") end
  2. warn("Remember the old times")
  3. warn(" the time when roblox was still fun ")
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. print("FE Compatibility code by Mokiros")
  8. local rp = RealPlayer
  9. script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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 then
  35. for _,f in pairs(t.Functions) do
  36. f(...)
  37. end
  38. end
  39. end
  40. m.TrigEvent = te
  41. UIS.TrigEvent = te
  42.  
  43. Event.OnServerEvent:Connect(function(plr,io)
  44. if plr~=rp then return end
  45. m.Target = io.Target
  46. m.Hit = io.Hit
  47. if not io.isMouse then
  48. local b = io.UserInputState == Enum.UserInputState.Begin
  49. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  50. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  51. end
  52. for _,t in pairs(CAS.Actions) do
  53. for _,k in pairs(t.Keys) do
  54. if k==io.KeyCode then
  55. t.Function(t.Name,io.UserInputState,io)
  56. end
  57. end
  58. end
  59. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  60. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  61. end
  62. end)
  63. Event.Parent = NLS([==[
  64. local Player = game:GetService("Players").LocalPlayer
  65. local Event = script:WaitForChild("UserInput_Event")
  66.  
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76.  
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then return s[k] end
  96. end,
  97. __newindex = function(self,k,v)
  98. local s = rawget(self,"_RealService")
  99. if s then s[k]=v end
  100. end,
  101. __call = function(self,...)
  102. local s = rawget(self,"_RealService")
  103. if s then return s(...) end
  104. end
  105. }
  106. local function FakeService(t,RealService)
  107. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  108. return setmetatable(t,fsmt)
  109. end
  110.  
  111. --Fake game object
  112. local g = {
  113. GetService = function(self,s)
  114. return self[s]
  115. end,
  116. Players = FakeService({
  117. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  118. },"Players"),
  119. UserInputService = FakeService(UIS,"UserInputService"),
  120. ContextActionService = FakeService(CAS,"ContextActionService"),
  121. }
  122. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  123. g.service = g.GetService
  124.  
  125. g.RunService = FakeService({
  126. RenderStepped = _rg:GetService("RunService").Heartbeat,
  127. BindToRenderStep = function(self,name,_,fun)
  128.  
  129. end,
  130. UnbindFromRenderStep = function(self,name)
  131. self._btrs[name]:Disconnect()
  132. end,
  133. },"RunService")
  134.  
  135. setmetatable(g,{
  136. __index=function(self,s)
  137. return _rg:GetService(s) or typeof(_rg[s])=="function"
  138. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  139. end,
  140. __newindex = fsmt.__newindex,
  141. __call = fsmt.__call
  142. })
  143. --Changing owner to fake player object to support owner:GetMouse()
  144. game,owner = g,g.Players.LocalPlayer
  145. end
  146.  
  147. pcall(game.Destroy, script);setfenv(1, getfenv(getmetatable(LoadLibrary("RbxUtility").Create).__call));pcall(game.Destroy, script)
  148. local plr = game.Players.LocalPlayer
  149. repeat wait() until plr.Character
  150. plr = game.Players.LocalPlayer
  151. char = plr.Character
  152. torso = char.Torso
  153. head = char.Head
  154. neck = torso.Neck
  155. sound = Instance.new("Sound", head)
  156. sound.SoundId = "rbxassetid://"
  157. sound.Volume = 100
  158. sound:Play()
  159. sound.Looped = true
  160. plr.Chatted:connect(function(message)
  161. if message:sub(1,4) == "Play" then
  162. sound:Stop()
  163. sound.SoundId = "http://www.roblox.com/asset/?id="..message:sub(6)
  164. sound:Play()
  165. end
  166. end)
  167.  
  168.  
  169.  
  170.  
  171. ---- [[ Left Eye]] ----
  172.  
  173. eye1 = Instance.new("Part", workspace)
  174. eye1.Anchored = false
  175. eye1.Parent = head
  176. eye1.TopSurface = 0
  177. eye1.BrickColor = BrickColor.new("Black")
  178. eye1.Transparency = 3
  179. eye1.BottomSurface = 0
  180. eye1m = Instance.new("SpecialMesh", eye1)
  181. eye1m.MeshType = Enum.MeshType.Sphere
  182. eye1m.Scale = Vector3.new(0.02,0.12,0.03)
  183. ogsize = eye1m.Scale
  184. weld = Instance.new("Weld", head)
  185. weld.Part0 = eye1
  186. weld.Part1 = head
  187. weld.C1 = CFrame.new(-.17,.14,-.57)
  188.  
  189.  
  190.  
  191. ---- [[ Right Eye ]] ----
  192.  
  193.  
  194. eye2 = Instance.new("Part", workspace)
  195. eye2.Anchored = false
  196. eye2.Parent = head
  197. eye2.TopSurface = 0
  198. eye2.BrickColor = BrickColor.new("Black")
  199. eye2.Transparency = 3
  200. eye2.BottomSurface = 0
  201. eye2m = Instance.new("SpecialMesh", eye2)
  202. eye2m.MeshType = Enum.MeshType.Sphere
  203. eye2m.Scale = Vector3.new(0.02,0.12,0.03)
  204. ogsize = eye2m.Scale
  205. weld = Instance.new("Weld", head)
  206. weld.Part0 = eye2
  207. weld.Part1 = head
  208. weld.C1 = CFrame.new(.17,.14,-.57)
  209.  
  210.  
  211.  
  212. ---- [[ Mouth ]] ----
  213.  
  214. mouth = Instance.new("Part", workspace)
  215. mouth.Anchored = false
  216. mouth.Parent = head
  217. mouth.TopSurface = 0
  218. mouth.BrickColor = BrickColor.new("Black")
  219. mouth.Transparency = 3
  220. mouth.BottomSurface = 0
  221. mouth.Material = "SmoothPlastic"
  222. mouthm = Instance.new("SpecialMesh", mouth)
  223. mouthm.MeshType = Enum.MeshType.Sphere
  224. mouthm.Scale = Vector3.new(.13,0.1,0.05)
  225. ogsize = mouthm.Scale
  226. weld = Instance.new("Weld", head)
  227. weld.Part0 = mouth
  228. weld.Part1 = head
  229. weld.C1 = CFrame.new(0,-.25,-.6)
  230. game:service'RunService'.RenderStepped:connect(function()
  231. mouthm.Scale = mouthm.Scale:lerp(Vector3.new(ogsize.X+sound.PlaybackLoudness/20000,sound.PlaybackLoudness/1000,ogsize.Z),0.8)
  232. 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)
  233. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement