Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When Touching Part Value Doesnt Change And Wait?

Asked by 1 year ago
Edited 1 year 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

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)
1
Are you sure your script is correct? Line 8 is a syntax error Xapelize 2658 — 1y
0
well yeah thats what i need help with (i should of included that in the post) JmoneyPlayzOfficial 49 — 1y
0
i updated the script JmoneyPlayzOfficial 49 — 1y

Answer this question