Hello. So I made a timer showing only when a player touches a specific part. However, when it counts, everybody can see it. How can I make sure that the player who touched the part is the ONLY ONE that views the timer?
Script located in ServerScriptService:
rs = game.ReplicatedStorage
TimeSeconds = rs.Seconds
TimeMinutes = rs.Minutes
TimeHours = rs.Hours
TimerParte = game.Workspace:WaitForChild("TimerPart")
local debounce = false
TimerParte.Touched:Connect(function()
if debounce == false then
debounce = true
for i = 0, 86400, 1 do
TimeSeconds.Value += 1
if TimeSeconds.Value == 60 then
TimeSeconds.Value = 0
TimeMinutes.Value += 1
end
if TimeMinutes.Value == 60 then
TimeMinutes.Value = 0
TimeHours.Value += 1
end
wait(1)
end
end
end)
The local script for displaying the timer:
TimerGUI = script.Parent
rs = game.ReplicatedStorage
timerlabel = script.Parent:WaitForChild("TextLabel")
TimerParte = game.Workspace:WaitForChild("TimerPart")
TimerParte.Touched:Connect(function()
rs.Seconds.Changed:Connect(function()
timerlabel.Text = tostring(string.format("%0.2i", rs.Hours.Value) .. ":" .. string.format("%0.2i", rs.Minutes.Value) .. ":" .. string.format("%0.2i", rs.Seconds.Value))
end)
end)
** You are now Level 7! **
