SHARE
TWEET

Untitled

a guest Nov 19th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. local plr = owner
  84. repeat wait() until plr.Character
  85. local char = plr.Character
  86. local baldgui =Instance.new("BillboardGui")
  87. baldgui.Parent = char.Head
  88. baldgui.Adornee = char.Head
  89. baldgui.Size=UDim2.new(3.5,0,8.5,0)
  90. baldgui.StudsOffset=Vector3.new(0,0.2,0)
  91. local boosted = false
  92. local playing = false
  93. local doors = {nil}
  94. local doormag = {nil}
  95. local dooropeneds = {nil}
  96. local doorwaits = {nil}
  97. local doorsound = Instance.new("Sound",nil)
  98. local doorosunds = {"rbxassetid://1874737540","rbxassetid://1874737174"}
  99. local doorsprites = {"http://www.roblox.com/asset/?id=1804020342","http://www.roblox.com/asset/?id=1804457660"}
  100. local SlapSound = Instance.new("Sound",char.Torso)
  101. local doorsoundplays = {nil}
  102. local hnsm = Instance.new("Sound",char.Torso)
  103. SlapSound.Volume = 10
  104. hnsm.Volume = 10
  105. local image =Instance.new("ImageLabel")
  106. image.Image = "http://www.roblox.com/asset/?id=4283303552"
  107. 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"}
  108. image.Size=UDim2.new(1,0,1,0)
  109. image.Position=UDim2.new(0,0,0,0)
  110. image.BackgroundTransparency = 1
  111. image.Parent=baldgui
  112. local rs = game:GetService("RunService").Stepped
  113. repeat wait() until char:FindFirstChildOfClass("Accessory")
  114. char.Humanoid.Animator:Destroy()
  115. rs:Connect(function()
  116.     if #doormag > -1 then
  117.         for i = 0,#dooropeneds do
  118.             doormag[i] = (doors[i].Position - char.Torso.Position).magnitude
  119.             print(doormag[i])
  120.             doorwaits[i] = doorwaits[i] - 0.025
  121.             if doormag[i] < 3 then
  122.                 doorwaits[i] = 3
  123.                 dooropeneds[i] = true
  124.                 SetDecalTexture(doorsprites[2],doors[i].f)
  125.                 SetDecalTexture(doorsprites[2],doors[i].b)
  126.                 setCollid(doors[i],false)
  127.                 setTrans(doors[i],1)
  128.                 if doorsoundplays[i] == 0 then
  129.                     setSoundID(doors[i].Sound,doorosunds[2])
  130.                     doors[i].Sound:Play()
  131.                     doorsoundplays[i] = 1
  132.                 end
  133.             else
  134.                 if doorwaits[i] < 0.1 then
  135.                     dooropeneds[i] = false
  136.                     SetDecalTexture(doorsprites[1],doors[i].f)
  137.                     SetDecalTexture(doorsprites[1],doors[i].b)
  138.                     setCollid(doors[i],true)
  139.                     setTrans(doors[i],0)
  140.                     if doorsoundplays[i] == 1 then
  141.                         setSoundID(doors[i].Sound,doorosunds[1])
  142.                         doors[i].Sound:Play()
  143.                         doorsoundplays[i] = 0
  144.                     end
  145.                 end
  146.             end
  147.         end
  148.     end
  149. end)
  150. 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"}
  151. for i,v in pairs(char:GetChildren()) do
  152.     if v.ClassName == "Part" or v.ClassName == "Union" or v.ClassName == "MeshPart" then
  153.         v.Transparency = 1
  154.     end
  155.     if v.ClassName == "Accessory" then
  156.         v.Handle.Transparency = 1
  157.     end
  158. end
  159.  
  160. function setSoundID(sound,id)
  161.     sound.SoundId = id
  162. end
  163. function setPlrWalkSpeed(speed)
  164.     char.Humanoid.WalkSpeed = speed
  165. end
  166. function setTrans(part,trans)
  167.     part.Transparency = trans
  168. end
  169. function setCollid(part,col)
  170.     part.CanCollide = col
  171. end
  172. setPlrWalkSpeed(0)
  173. setSoundID(SlapSound,"rbxassetid://1804495872")
  174. setSoundID(hnsm,"rbxassetid://399712419")
  175. SlapSound.TimePosition = 0.1
  176. char.Head.face.Transparency = 1
  177. function Slap()
  178.     SlapSound:Play()
  179.     if boosted == false  then
  180.         setPlrWalkSpeed(60)
  181.         boosted = true
  182.     end
  183.     image.Image = slapimages[1]
  184.     wait(0.3)
  185.     if boosted == true then
  186.         setPlrWalkSpeed(0)
  187.     end
  188.    
  189.     boosted = false
  190.     if playing == false then
  191.         playing = true
  192.         for i=2,#slapimages do
  193.             wait(0.05)
  194.             image.Image = slapimages[i]
  195.         end
  196.         playing = false
  197.     end
  198. end
  199. function SetDecalTexture(texture,decal)
  200.     decal.Texture = texture
  201. end
  202. function SDS(decal,side)
  203.     decal.Face = side
  204. end
  205. function milk()
  206.     hnsm:Play()
  207.     local tim = 0
  208.     for i = 0,20 do
  209.         wait(0.05)
  210.         tim=tim+1
  211.         if tim > #talkimages then
  212.             tim = 1
  213.         end
  214.         image.Image = talkimages[tim]
  215.     end
  216.     image.Image = talkimages[#talkimages]
  217.     baldgui.Size=UDim2.new(3.5,0,8.5,0)
  218.     image.Rotation = 0
  219. end
  220. mouse.Button1Down:connect(function()
  221.     Slap()
  222. end)
  223. mouse.KeyDown:connect(function(k)
  224.     if k == "m" then
  225.         milk()
  226.     end
  227.     if k == "n" then
  228.         image.Image = "http://www.roblox.com/asset/?id=4392323375"
  229.         setPlrWalkSpeed(60)
  230.     end
  231.     if k == "e" then
  232.         local door = Instance.new("Part",char)
  233.         table.insert(doors,0,door)
  234.         table.insert(dooropeneds,0,false)
  235.         table.insert(doorsoundplays,0,0)
  236.         table.insert(doormag,0,0)
  237.         table.insert(doorwaits,0,0)
  238.         local sound = Instance.new("Sound",door)
  239.         sound.Volume = 3
  240.         door.Size = Vector3.new(6, 12, 0.05)
  241.         door.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-9)
  242.         local front = Instance.new("Decal",door)
  243.         front.Name = "f"
  244.         local back = Instance.new("Decal",door)
  245.         back.Name = "b"
  246.         SetDecalTexture(doorsprites[1],front)
  247.         SetDecalTexture(doorsprites[1],back)
  248.         SDS(front,"Front")
  249.         SDS(front,"Back")
  250.         door.Anchored = true
  251.     end
  252. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top