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 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

01local function plrgui()
02    for _, plr in ipairs(game:GetService('Players'):GetChildren()) do
03        plr.PlayerGui.Tasks.Frame.tv.Value.Value += 1
04    end
05end
06local function plrguicheck(e)
07    for _, plr in ipairs(game:GetService('Players'):GetChildren()) do
08        e = plr.PlayerGui.Tasks.Frame.tv.Value
09    end
10end
11script.Parent.Touched:Connect(function(hit)
12    local player = hit.Parent:FindFirstChild('Humanoid')
13    if player and plrguicheck(.Value) < 60 then
14        task.wait(1)
15        plrgui()
16    elseif plrguicheck(.Value) >= 60 then
17        script.Enabled = false
18    end
19end)
1
Are you sure your script is correct? Line 8 is a syntax error Xapelize 2658 — 2y
0
well yeah thats what i need help with (i should of included that in the post) JmoneyPlayzOfficial 49 — 2y
0
i updated the script JmoneyPlayzOfficial 49 — 2y

Answer this question