Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.78 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  19. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  20. do
  21. print("FE Compatibility code by Mokiros")
  22. script.Parent = Player.Character
  23.  
  24. --RemoteEvent for communicating
  25. local Event = Instance.new("RemoteEvent")
  26. Event.Name = "UserInput_Event"
  27.  
  28. --Fake event to make stuff like Mouse.KeyDown work
  29. local function fakeEvent()
  30. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  31. t.connect = t.Connect
  32. return t
  33. end
  34.  
  35. --Creating fake input objects with fake variables
  36. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  37. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  38. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  39. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  40. end}
  41. --Merged 2 functions into one by checking amount of arguments
  42. CAS.UnbindAction = CAS.BindAction
  43.  
  44. --This function will trigger the events that have been :Connect()'ed
  45. local function te(self,ev,...)
  46. local t = m[ev]
  47. if t and t._fakeEvent and t.Function then
  48. t.Function(...)
  49. end
  50. end
  51. m.TrigEvent = te
  52. UIS.TrigEvent = te
  53.  
  54. Event.OnServerEvent:Connect(function(plr,io)
  55. if plr~=Player then return end
  56. if io.isMouse then
  57. m.Target = io.Target
  58. m.Hit = io.Hit
  59. else
  60. local b = io.UserInputState == Enum.UserInputState.Begin
  61. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  62. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  63. end
  64. for _,t in pairs(CAS.Actions) do
  65. for _,k in pairs(t.Keys) do
  66. if k==io.KeyCode then
  67. t.Function(t.Name,io.UserInputState,io)
  68. end
  69. end
  70. end
  71. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  72. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  73. end
  74. end)
  75. Event.Parent = NLS([==[
  76. local Player = game:GetService("Players").LocalPlayer
  77. local Event = script:WaitForChild("UserInput_Event")
  78.  
  79. local UIS = game:GetService("UserInputService")
  80. local input = function(io,a)
  81. if a then return end
  82. --Since InputObject is a client-side instance, we create and pass table instead
  83. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  84. end
  85. UIS.InputBegan:Connect(input)
  86. UIS.InputEnded:Connect(input)
  87.  
  88. local Mouse = Player:GetMouse()
  89. local h,t
  90. --Give the server mouse data 30 times every second, but only if the values changed
  91. --If player is not moving their mouse, client won't fire events
  92. while wait(1/30) do
  93. if h~=Mouse.Hit or t~=Mouse.Target then
  94. h,t=Mouse.Hit,Mouse.Target
  95. Event:FireServer({isMouse=true,Target=t,Hit=h})
  96. end
  97. end]==],Player.Character)
  98. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  99. end
  100. local plr = owner
  101. repeat wait() until plr.Character
  102. local char = plr.Character
  103. local baldgui =Instance.new("BillboardGui")
  104. baldgui.Parent = char.Head
  105. baldgui.Adornee = char.Head
  106. baldgui.Size=UDim2.new(3.5,0,8.5,0)
  107. baldgui.StudsOffset=Vector3.new(0,0.2,0)
  108. local boosted = false
  109. local playing = false
  110. local doors = {nil}
  111. local doormag = {nil}
  112. local dooropeneds = {nil}
  113. local doorwaits = {nil}
  114. local doorsound = Instance.new("Sound",nil)
  115. local doorosunds = {"rbxassetid://1874737540","rbxassetid://1874737174"}
  116. local doorsprites = {"http://www.roblox.com/asset/?id=1804020342","http://www.roblox.com/asset/?id=1804457660"}
  117. local SlapSound = Instance.new("Sound",char.Torso)
  118. local doorsoundplays = {nil}
  119. local hnsm = Instance.new("Sound",char.Torso)
  120. SlapSound.Volume = 10
  121. hnsm.Volume = 10
  122. local image =Instance.new("ImageLabel")
  123. image.Image = "http://www.roblox.com/asset/?id=4283303552"
  124. local slapimages = {"http://www.roblox.com/asset/?id=4283300825","http://www.roblox.com/asset/?id=4283301491","http://www.roblox.com/asset/?id=4283302321","http://www.roblox.com/asset/?id=4283302955","http://www.roblox.com/asset/?id=4283303552"}
  125. image.Size=UDim2.new(1,0,1,0)
  126. image.Position=UDim2.new(0,0,0,0)
  127. image.BackgroundTransparency = 1
  128. image.Parent=baldgui
  129. local rs = game:GetService("RunService").Stepped
  130. repeat wait() until char:FindFirstChildOfClass("Accessory")
  131. char.Humanoid.Animator:Destroy()
  132. rs:Connect(function()
  133. if #doormag > -1 then
  134. for i = 0,#dooropeneds do
  135. doormag[i] = (doors[i].Position - char.Torso.Position).magnitude
  136. doorwaits[i] = doorwaits[i] - 0.025
  137. if doormag[i] < 6 then
  138. doorwaits[i] = 3
  139. dooropeneds[i] = true
  140. SetDecalTexture(doorsprites[2],doors[i].f)
  141. SetDecalTexture(doorsprites[2],doors[i].b)
  142. setCollid(doors[i],false)
  143. setTrans(doors[i],1)
  144. if doorsoundplays[i] == 0 then
  145. setSoundID(doors[i].Sound,doorosunds[2])
  146. doors[i].Sound:Play()
  147. doorsoundplays[i] = 1
  148. end
  149. else
  150. if doorwaits[i] < 0.1 then
  151. dooropeneds[i] = false
  152. SetDecalTexture(doorsprites[1],doors[i].f)
  153. SetDecalTexture(doorsprites[1],doors[i].b)
  154. setCollid(doors[i],true)
  155. setTrans(doors[i],0)
  156. if doorsoundplays[i] == 1 then
  157. setSoundID(doors[i].Sound,doorosunds[1])
  158. doors[i].Sound:Play()
  159. doorsoundplays[i] = 0
  160. end
  161. end
  162. end
  163. end
  164. end
  165. end)
  166. local talkimages = {"http://www.roblox.com/asset/?id=4392260496","http://www.roblox.com/asset/?id=4392261038","http://www.roblox.com/asset/?id=4392260496","http://www.roblox.com/asset/?id=4283303552"}
  167. for i,v in pairs(char:GetChildren()) do
  168. if v.ClassName == "Part" or v.ClassName == "Union" or v.ClassName == "MeshPart" then
  169. v.Transparency = 1
  170. end
  171. if v.ClassName == "Accessory" then
  172. v.Handle.Transparency = 1
  173. end
  174. end
  175.  
  176. function setSoundID(sound,id)
  177. sound.SoundId = id
  178. end
  179. function setPlrWalkSpeed(speed)
  180. char.Humanoid.WalkSpeed = speed
  181. end
  182. function setTrans(part,trans)
  183. part.Transparency = trans
  184. end
  185. function setCollid(part,col)
  186. part.CanCollide = col
  187. end
  188. setPlrWalkSpeed(0)
  189. setSoundID(SlapSound,"rbxassetid://1804495872")
  190. setSoundID(hnsm,"rbxassetid://399712419")
  191. SlapSound.TimePosition = 0.1
  192. char.Head.face.Transparency = 1
  193. function Slap()
  194. SlapSound:Play()
  195. if boosted == false then
  196. setPlrWalkSpeed(60)
  197. boosted = true
  198. end
  199. image.Image = slapimages[1]
  200. wait(0.3)
  201. if boosted == true then
  202. setPlrWalkSpeed(0)
  203. end
  204.  
  205. boosted = false
  206. if playing == false then
  207. playing = true
  208. for i=2,#slapimages do
  209. wait(0.05)
  210. image.Image = slapimages[i]
  211. end
  212. playing = false
  213. end
  214. end
  215. function SetDecalTexture(texture,decal)
  216. decal.Texture = texture
  217. end
  218. function SDS(decal,side)
  219. decal.Face = side
  220. end
  221. function milk()
  222. hnsm:Play()
  223. local tim = 0
  224. for i = 0,20 do
  225. wait(0.05)
  226. tim=tim+1
  227. if tim > #talkimages then
  228. tim = 1
  229. end
  230. image.Image = talkimages[tim]
  231. end
  232. image.Image = talkimages[#talkimages]
  233. baldgui.Size=UDim2.new(3.5,0,8.5,0)
  234. image.Rotation = 0
  235. end
  236. mouse.Button1Down:connect(function()
  237. Slap()
  238. end)
  239. mouse.KeyDown:connect(function(k)
  240. if k == "m" then
  241. milk()
  242. end
  243. if k == "n" then
  244. image.Image = "http://www.roblox.com/asset/?id=4392323375"
  245. setPlrWalkSpeed(60)
  246. end
  247. if k == "e" then
  248. local door = Instance.new("Part",char)
  249. table.insert(doors,0,door)
  250. table.insert(dooropeneds,0,false)
  251. table.insert(doorsoundplays,0,0)
  252. table.insert(doormag,0,0)
  253. table.insert(doorwaits,0,0)
  254. local sound = Instance.new("Sound",door)
  255. sound.Volume = 3
  256. door.Size = Vector3.new(6, 12, 0.05)
  257. door.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-9)
  258. local front = Instance.new("Decal",door)
  259. front.Name = "f"
  260. local back = Instance.new("Decal",door)
  261. back.Name = "b"
  262. SetDecalTexture(doorsprites[1],front)
  263. SetDecalTexture(doorsprites[1],back)
  264. SDS(front,"Front")
  265. SDS(front,"Back")
  266. door.Anchored = true
  267. end
  268. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement