Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't this change the value?

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

This discussion is preserved as it was. New answers, comments, and votes are closed.