Advertisement
doryna2281337

Untitled

Aug 14th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.39 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")
  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 = game:GetService("Players").LocalPlayer
  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.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. local Player = owner
  85. local Character = Player.Character
  86. local Torso = Character["Torso"]
  87. local Head = Character["Head"]
  88. local Humanoid = Character.Humanoid
  89. Character["Right Leg"]:Remove()
  90. Character["Left Leg"]:Remove()
  91.  
  92. wait()
  93. Head.Transparency = 1
  94. Humanoid.MaxHealth = math.huge
  95. Humanoid.Health = Humanoid.MaxHealth
  96.  
  97.  
  98. function CreateWeld(Part0,Part1,C1)
  99. local weld = Instance.new("Weld")
  100. weld.Parent = Part0
  101. weld.Part0 = Part0
  102. weld.Part1 = Part1
  103. weld.C1 = C1
  104. end
  105.  
  106. local GiantHead = Instance.new("Part")
  107. GiantHead.Parent = Head
  108. GiantHead.Color = Head.Color
  109. GiantHead.Size = Vector3.new(5,5,5)
  110. GiantHead.CanCollide = true
  111. GiantHead.Locked = true
  112. GiantHead.TopSurface = "Smooth"
  113. GiantHead.BottomSurface = "Smooth"
  114. local GiantHeadWeld = CreateWeld(Torso,GiantHead,CFrame.new(0,-1,0))
  115. local Mouth = Instance.new("Part")
  116. Mouth.Parent = GiantHead
  117. Mouth.Color = Color3.new(0,0,0)
  118. Mouth.Size = Vector3.new(3.88, 0.2, 0.5)
  119. Mouth.CanCollide = false
  120. Mouth.Locked = true
  121. Mouth.TopSurface = "Smooth"
  122. Mouth.BottomSurface = "Smooth"
  123. local MouthMesh = Instance.new("SpecialMesh")
  124. MouthMesh.Parent = Mouth
  125. MouthMesh.MeshType = "Sphere"
  126. local MouthWeld = CreateWeld(GiantHead,Mouth,CFrame.new(0,1,2.5))
  127. local Eye = Instance.new("Part")
  128. Eye.Parent = GiantHead
  129. Eye.BrickColor = BrickColor.new("Lily white")
  130. Eye.Size = Vector3.new(2,2,2)
  131. Eye.CanCollide = false
  132. Eye.TopSurface = "Smooth"
  133. Eye.BottomSurface = "Smooth"
  134. local EyeMesh = Instance.new("SpecialMesh")
  135. EyeMesh.Parent = Eye
  136. EyeMesh.MeshType = "Sphere"
  137. CreateWeld(GiantHead,Eye,CFrame.new(1,-1,1.6))
  138. local Pupil = Instance.new("Part")
  139. Pupil.Parent = Eye
  140. Pupil.Color = Torso.Color
  141. Pupil.CanCollide = false
  142. Pupil.Size = Vector3.new(0.5,0.5,0.5)
  143. Pupil.TopSurface = "Smooth"
  144. Pupil.BottomSurface = "Smooth"
  145. local PupilMesh = Instance.new("SpecialMesh")
  146. PupilMesh.Parent = Pupil
  147. PupilMesh.MeshType = "Sphere"
  148. CreateWeld(Eye,Pupil,CFrame.new(0,0,0.8))
  149. local coro = coroutine.resume(coroutine.create(function()
  150. while wait(5) do
  151. Eye.Color = Head.Color
  152. Pupil.Transparency = 1
  153. wait(0.01)
  154. Eye.BrickColor = BrickColor.new("Lily white")
  155. Pupil.Transparency = 0
  156. end
  157. end))
  158. local Eye = Instance.new("Part")
  159. Eye.Parent = GiantHead
  160. Eye.BrickColor = BrickColor.new("Lily white")
  161. Eye.Size = Vector3.new(2,2,2)
  162. Eye.CanCollide = false
  163. Eye.TopSurface = "Smooth"
  164. Eye.BottomSurface = "Smooth"
  165. local EyeMesh = Instance.new("SpecialMesh")
  166. EyeMesh.Parent = Eye
  167. EyeMesh.MeshType = "Sphere"
  168. CreateWeld(GiantHead,Eye,CFrame.new(-1,-1,1.6))
  169. local Pupil = Instance.new("Part")
  170. Pupil.Parent = Eye
  171. Pupil.Color = Torso.Color
  172. Pupil.CanCollide = false
  173. Pupil.Size = Vector3.new(0.5,0.5,0.5)
  174. Pupil.TopSurface = "Smooth"
  175. Pupil.BottomSurface = "Smooth"
  176. local PupilMesh = Instance.new("SpecialMesh")
  177. PupilMesh.Parent = Pupil
  178. PupilMesh.MeshType = "Sphere"
  179. CreateWeld(Eye,Pupil,CFrame.new(0,0,0.8))
  180. local coro = coroutine.resume(coroutine.create(function()
  181. while wait(5) do
  182. Eye.Color = Head.Color
  183. Pupil.Transparency = 1
  184. wait(0.01)
  185. Eye.BrickColor = BrickColor.new("Lily white")
  186. Pupil.Transparency = 0
  187. end
  188. end))
  189. for _,v in pairs(Character:GetChildren())do
  190. if v:IsA("Hat") then
  191. for _,c in pairs(v:GetChildren())do
  192. if c:IsA("Part") then
  193. for _,d in pairs(c:GetChildren())do
  194. if d:IsA("SpecialMesh") then
  195. d.Scale = d.Scale * Vector3.new(5,5,5)
  196. d.Offset = Vector3.new(0,(c.Position - GiantHead.Position).magnitude * 2.5,0)
  197. end
  198. end
  199. end
  200. end
  201. end
  202. end
  203. local Sound = Instance.new("Sound")
  204. Sound.Parent = Head
  205. Sound.Looped = true
  206. Sound.SoundId = "rbxassetid://"
  207. Sound.Volume = math.huge
  208. ID = ""
  209. local SoundIsPlaying = false
  210.  
  211. Player.Chatted:connect(function(msg)
  212. if msg:sub(1,6):lower() == "music;" then
  213. local Id = string.sub(msg,7)
  214. Sound.SoundId = "rbxassetid://"..Id
  215. ID = Id
  216. Sound:Play()
  217. SoundIsPlaying = true
  218. end
  219. end)
  220. while wait(0.1) do
  221. if SoundIsPlaying == true then
  222. if Sound.Parent == nil then
  223. local Sound2 = Instance.new("Sound")
  224. Sound2.Parent = Head
  225. Sound2.Looped = true
  226. Sound2.SoundId = "rbxassetid://"..ID
  227. Sound2.Volume = math.huge
  228. Sound2:Play()
  229. Sound = Sound2
  230. end
  231. if Sound.PlaybackLoudness > 1 then
  232. Mouth.Size = Vector3.new(Sound.PlaybackLoudness/150,Sound.PlaybackLoudness/250,Sound.PlaybackLoudness/2000)
  233. local MouthWeld = CreateWeld(GiantHead,Mouth,CFrame.new(0,1,2.5))
  234. elseif Sound.PlaybackLoudness <= 1 then
  235. Mouth.Size = Vector3.new(3.88, 0.2, 0.5)
  236. local MouthWeld = CreateWeld(GiantHead,Mouth,CFrame.new(0,1,2.5))
  237. end
  238. end
  239. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement