Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If you clicked this thanks for Helping me!
- `
- So i am working on a skateboarding game where you can buy Skateboards with in-game cash.
- I was going to add a Game Pass (Tool) That lets you do many tricks with the skateboard by pressing down a key
- But the script only works with boards named "Boards" or other names you give them.
- As you know all Cars (Boards in my case) Are named (player.Name .. "'s" .. NameOfCar) And that wont just work
- Here is just 1 trick you can do out of many more -
- local de = script.Parent.SpinDebounce
- function onKeyDown(key)
- if key == "e" and de.Value == false and game.Players.LocalPlayer.Character:findFirstChild("Board") ~= nil then
- if game.Players.LocalPlayer.Character:findFirstChild("Board").SkateboardPlatform.InAir.Value == true or false then
- de.Value = true
- local s = game.Players.LocalPlayer.Character:findFirstChild("Board").SkateboardPlatform
- CF = s.CFrame
- Gyro = Instance.new("BodyGyro")
- Gyro.P = Gyro.P*10
- Gyro.maxTorque = Vector3.new(100000,100000,100000)*999
- Gyro.cframe = CF
- Gyro.Parent = s
- for i=1, 7 do
- Gyro.cframe = Gyro.cframe*CFrame.fromEulerAnglesXYZ(0,math.pi/-7,0)
- wait()
- end
- CF2 = s.CFrame
- Gyro.cframe = CF2
- wait()
- Gyro:Remove()
- de.Value = false
- end
- end
- end
- function s(mouse)
- mouse.KeyDown:connect(onKeyDown)
- end
- script.Parent.Selected:connect(s)
Advertisement
Add Comment
Please, Sign In to add comment