I have a timer Gui for my Ninja Warrior game, and here are the components:
A Part called Start to start the timer
A Part called ClearButton to finish the course and disable the timer(overlap debug)
A Part called Reset to reset the timer Gui and enable it for Start to be clicked
Here are the scripts (they do all work and if you correct me you will be wrong):
Start Script:
script.Parent.ClickDetector.MouseClick:Connect(function()
for i = 100, 0, -1 do
for _,p in pairs(game.Players:GetPlayers()) do
p.PlayerGui.ScreenGui.TextLabel.Text = ""..i.." seconds"
wait(1)
end
if i == 0 then
for _,k in pairs(game.Players:GetPlayers()) do
k.PlayerGui.ScreenGui.TextLabel.Text = "Failure!"
end
game.Workspace.ClearButton.Script.Disabled = true -- Prevents the player from clearing after they have failed
end
end
end)
ClearButton Script:
s = Instance.new("Sound")
s.Parent = script.Parent -- Set the Sound Parent to the ClearButton
s.SoundId = "rbxassetid://139437388"
s.Volume = 1
s.Looped = false
script.Parent.ClickDetector.MouseClick:Connect(function()
s:Play()
for _,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.ScreenGui.TextLabel.Text = "Clear!"
end
game.Workspace.Start.Script.Disabled = true -- Disable the timer
end)
Reset Script:
script.Parent.ClickDetector.MouseClick:Connect(function()
if game.Workspace.Start.Script.Disabled == true then -- If the timer is disabled...
game.Workspace.Start.Script.Disabled = false -- Enable it
for _,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.ScreenGui.TextLabel.Text = "Timer enabled" -- Verification msg
end
end
end)
Now suppose that, in the script belonging to Start, I want to detect if a player has touched terrain, specifically water. I've tried everything I know and I can't seem to get it. How would you detect if a player has touched terrain? An example would be nice.

1 comment
I don't know how to detect if you touch terrain but can't you check for the swimming humanoid state?