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

Why won't this change the value?

Asked by 8 years ago

So this script is supposed to check if any of the other values are the same. 1 is. It's supposed to find another player and get that player that matches what I need. 1 Player does match out of 2 players. I need it to change the parents value to that players name but it doesn't. It changes it to "". HELP!

script.Parent.Na.Value = ""
script.Parent.Changed:connect(function()
    if script.Parent.Value ~= "" then
        local k = script.Parent.Value
        local l = script.Parent.Parent.Parent:GetChildren()
        for i = 1, #l do
            if l[i]:FindFirstChild("Owner") then
                if l[i].Owner.Value == k then
                    local j = game.Players:getChildren()
                    repeat
                        wait(0.01)
                        d = (j[math.random(1,#j)])
                    until d.Name ~= k and d.Setting.Value == "Playing" and d.PlayerGui:FindFirstChild("PlayingGui") and d.PlayerGui.PlayingGui.Timer.Value == game.Workspace.Main.Winners["1"].Value
                    script.Parent.Na.Value = d.Name 
                    break
                end     
                wait(0.2)
                    script.Parent.Value = script.Parent.Na.Value
            else 
                --break
                --end
            end
        end
    end
end)

1 answer

Log in to vote
0
Answered by 8 years ago

Thanks for no help..

Ad

Answer this question