Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --define variables
- local time = 0
- local speed
- local T = false
- --functions, and other events
- function Igate(state)
- if state then
- workspace.C.CanCollide = true
- print("Locked")
- Else
- workspace.C.CanCollide = false
- End
- End
- script.Parent.B.Touched:Connect(function(
- T = true
- Igate(true)
- )end
- script.Parent.B.Touched:Connect(function(
- T = false
- Igate(false)
- Calculate()
- )end
- while true do
- while T do
- wait(1)
- time = time + 1
- end
- end
- function Calculate()
- speed = time / --distance
- print(speed)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement