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
local function plrgui()
for _, plr in ipairs(game:GetService('Players'):GetChildren()) do
plr.PlayerGui.Tasks.Frame.tv.Value.Value += 1
end
end
local function plrguicheck(e)
for _, plr in ipairs(game:GetService('Players'):GetChildren()) do
e = plr.PlayerGui.Tasks.Frame.tv.Value
end
end
script.Parent.Touched:Connect(function(hit)
local player = hit.Parent:FindFirstChild('Humanoid')
if player and plrguicheck(.Value) < 60 then
task.wait(1)
plrgui()
elseif plrguicheck(.Value) >= 60 then
script.Enabled = false
end
end)

3 comments
Are you sure your script is correct? Line 8 is a syntax error
well yeah thats what i need help with (i should of included that in the post)
i updated the script