Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uis = game:GetService("UserInputService")
- local access1Function = game.ReplicatedStorage:WaitForChild("access1Function")
- local thing = workspace.machines.bed1
- local position = workspace.machines.bed1.handle.CFrame
- local RS = game:GetService("ReplicatedStorage")
- local tpFunction = RS:WaitForChild("TpFunction")
- local tpPart = thing.invisiblePart
- local billboard = thing.part.BillboardGui
- local player = game:GetService("Players").LocalPlayer
- local character = player.Character
- local maxDistance = thing.part.BillboardGui.MaxDistance
- local distance = (thing.part.Position - character.HumanoidRootPart.Position).magnitude
- --// Variables
- local E_toggle = false
- uis.InputBegan:Connect(function(input, gameProcessed)
- local distance = (thing.part.Position - character.HumanoidRootPart.Position).magnitude
- E_toggle = false
- if input.KeyCode == Enum.KeyCode.E and distance <= maxDistance then
- if gameProcessed then return end
- local Tool = access1Function:InvokeServer()
- local animationid = script.animation1
- local animation1track = character.Humanoid:LoadAnimation(animationid)
- tpFunction:InvokeServer(character, tpPart)
- character.Humanoid.JumpPower = 0
- character.Humanoid.WalkSpeed = 0
- animation1track:Play()
- wait(animation1track)
- animation1track:Stop()
- if E_toggle then
- E_toggle = true
- if input.KeyCode == Enum.KeyCode.E then
- thing.Handle.CFrame = position
- local animationid3 = script.animation3
- local animation3track = character.Humanoid:LoadAnimation(animationid3)
- animation3track:Play()
- wait(animation3track)
- animation3track:Stop()
- game.ReplicatedStorage.ToolFunction1:InvokeServer(character)
- E_toggle = false
- character.Humanoid.JumpPower = 31
- character.Humanoid.WalkSpeed = 18
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement