When Touching Part Value Doesnt Change And Wait?
Asked by
2 years ago Edited 2 years ago
i have no idea what to title this
I'm making a script where it detects if your touching the part, if you are, it will wait a second, add 1 to everyone's value in playergui and it will wait another second then repeat. when the value reaches 60 or over. this script gets disabled. it doesnt work because of plrguicheck()
and before I added plrguicheck()
it didnt wait at all but then just suddenly stopped, does anyone have any ideas on how to fix it? (sorry if this doesnt make sense)
Script
01 | local function plrgui() |
02 | for _, plr in ipairs (game:GetService( 'Players' ):GetChildren()) do |
03 | plr.PlayerGui.Tasks.Frame.tv.Value.Value + = 1 |
06 | local function plrguicheck(e) |
07 | for _, plr in ipairs (game:GetService( 'Players' ):GetChildren()) do |
08 | e = plr.PlayerGui.Tasks.Frame.tv.Value |
11 | script.Parent.Touched:Connect( function (hit) |
12 | local player = hit.Parent:FindFirstChild( 'Humanoid' ) |
13 | if player and plrguicheck(.Value) < 60 then |
16 | elseif plrguicheck(.Value) > = 60 then |
17 | script.Enabled = false |