Looping a Script

I will try it out now, thank you.

Whoops, my bad. Like I said i typed the whole thing in devforum, mb lol

2 Likes

It didnā€™t work I donā€™t know why.

copy and repaste it, i made a minor mistake

Did you edit the message because I see no changes. (I already changed the attribute thing)

Weird, not sure why this wouldnt be working. Have you made sure its a regular script in serverscriptservice?

Yeah itā€™s a regular script, the information folder and the children inside of are created with another Server Script. Does it have anything to do with that?

any errors in output? if there is, its probably saying that Information or XP are nil

game.Players.PlayerAdded:Connect(function(plr)
       plr:WaitForChild("Information")
       plr.Information.XP:GetPropertyChangedSignal("Value"):Connect(function(ch)
                     if  plr.Information.XP.Value>Player.Information.XP.MaximumXP.Value then
                           Player.Information.Level.Value += 1
                           Player.Information.XP.MaximumXP.Value += math.random(5, 10)
			               Player.Information.XP.Value = 0
                     end
              end)
       end)
end)

Okay let me try this really quickly.

No I didnā€™t see any unless I mis-read.

Ah wait spotted it.

game.Players.PlayerAdded:Connect(function(plr)
       plr:WaitForChild("Information")
       plr.Information.XP:GetPropertyChangedSignal("Value"):Connect(function(ch)
                     if  plr.Information.XP.Value>plr.Information.XP.MaximumXP.Value then
                           plr.Information.Level.Value += 1
                           plr.Information.XP.MaximumXP.Value += math.random(5, 10)
			               plr.Information.XP.Value = 0
                     end
              end)
       end)
1 Like

I will try this now, hold on. And thanks.

The reason this many retrys happened was because I was too lazy to boot up studio and see the output. Sorry

1 Like

Itā€™s fine no worries, it wasnā€™t your fault. Thank you again.

Yeah it didnā€™t work Iā€™m so confused why it isnā€™t.

I tested it out myself just now and it did. Are you sure that everything is named correctly?

Yeah Iā€™m positive everything is named correctly.

Did you copy and paste it again?

Here is a screenshot of the explorer.

image