Guest User

Untitled

a guest
Oct 13th, 2018
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. If you clicked this thanks for Helping me!
  2. `
  3. So i am working on a skateboarding game where you can buy Skateboards with in-game cash.
  4. I was going to add a Game Pass (Tool) That lets you do many tricks with the skateboard by pressing down a key
  5. But the script only works with boards named "Boards" or other names you give them.
  6. As you know all Cars (Boards in my case) Are named (player.Name .. "'s" .. NameOfCar) And that wont just work
  7.  
  8. Here is just 1 trick you can do out of many more -
  9.  
  10.  
  11. local de = script.Parent.SpinDebounce
  12. function onKeyDown(key)
  13. if key == "e" and de.Value == false and game.Players.LocalPlayer.Character:findFirstChild("Board") ~= nil then
  14. if game.Players.LocalPlayer.Character:findFirstChild("Board").SkateboardPlatform.InAir.Value == true or false then
  15. de.Value = true
  16. local s = game.Players.LocalPlayer.Character:findFirstChild("Board").SkateboardPlatform
  17. CF = s.CFrame
  18. Gyro = Instance.new("BodyGyro")
  19. Gyro.P = Gyro.P*10
  20. Gyro.maxTorque = Vector3.new(100000,100000,100000)*999
  21. Gyro.cframe = CF
  22. Gyro.Parent = s
  23. for i=1, 7 do
  24. Gyro.cframe = Gyro.cframe*CFrame.fromEulerAnglesXYZ(0,math.pi/-7,0)
  25. wait()
  26. end
  27. CF2 = s.CFrame
  28. Gyro.cframe = CF2
  29. wait()
  30. Gyro:Remove()
  31. de.Value = false
  32. end
  33. end
  34. end
  35.  
  36. function s(mouse)
  37. mouse.KeyDown:connect(onKeyDown)
  38. end
  39.  
  40. script.Parent.Selected:connect(s)
Advertisement
Add Comment
Please, Sign In to add comment