why is my local script not running locally?
01 | local start = game.Workspace:FindFirstChild( "Start" ) |
02 | local endPart = game.Workspace:FindFirstChild( "End" ) |
03 | local textlabel = script.Parent |
04 | local finished = script.Parent.finished |
07 | for t = 0 , math.huge , 0.05 do |
09 | if finished.Value = = true then break end |
10 | local stringT = tostring (t) |
11 | if #( tostring (t)) = = 3 then |
13 | elseif #( tostring (t)) = = 1 then |
16 | textlabel.Text = tostring (t) |
20 | start.Touched:Connect( function (hit) |
21 | if not game.Players:GetPlayerFromCharacter(hit.Parent) then return end |
22 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
23 | local character = hit.Parent |
27 | endPart.Touched:Connect( function (hit) |
30 | finished.Value = false |
the code on top is for a timer. the timer starts when the players touches the "start" part and ends when player touches the "end" part
this is in a local script but for some reason the timer runs for every players, meaning globally. im confused, why is this running globally and not locally even though its a local script
local script is in StarterGui>ScreenGui>TextLabel>Localscript
any help is greatly appreciated!