Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer --gets the player from the playerlist
- local char = plr.Character --gets the character
- local hum = char:WaitForChild("Humanoid") --gets the humanoid
- local animation = hum:LoadAnimation(script:WaitForChild("Animation"))
- local mouse = plr:GetMouse() --gets the mouse and all the functions you can do with it
- local debounce = false --the cooldown variable
- mouse.KeyDown:Connect(function(key) --if a key has been pressed
- if debounce == true then return end -- if the cooldown is active then stop the function
- if key == "z" then --if the key is z YOU CAN CHANGE THIS SO IT IS ANY KEY YOU WANT!
- debounce = true --cooldown active!
- animation:Play()
- wait(.3) -- waits a certain amount of time before making the mountain
- script.mountainfunc:FireServer() --fires a function called mountainfunc in the script
- wait(10) --the cooldown
- debounce = false --cooldown is not active
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement