0 views0 copies0 likes
Timed Obby Start and Finish Gates
Universal script
Copy it, then test it in your own Studio place.
Script code
25 lines ยท 1.0 KBlocal Players = game:GetService("Players")local starts = {}local function owner(hit) local character = hit:FindFirstAncestorOfClass("Model") return character and Players:GetPlayerFromCharacter(character)endlocal function bind(player) player.CharacterAdded:Connect(function() starts[player] = nil end)endPlayers.PlayerAdded:Connect(bind)Players.PlayerRemoving:Connect(function(player) starts[player] = nil end)workspace:WaitForChild("RaceStart").Touched:Connect(function(hit) local player = owner(hit) if player and not starts[player] then starts[player] = workspace:GetServerTimeNow() end-- โฆopen Get script for the full sourceAbout this script
Create two anchored parts called RaceStart and RaceFinish in Workspace. Touching the start records server time for that player, and touching the finish ends the run and updates the player's personal best when appropriate. Both times are attributes so a race UI can display them later. Resetting the avatar cancels the active run. Test two players finishing in different orders.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.