local v = game.Players.LocalPlayer
if v.Name == "Player1" or game:GetService("MarketplaceService"):PlayerOwnsAsset(v,440723046)==true then
if v:FindFirstChild('leaderstats') then
if v.leaderstats:FindFirstChild('XP') then
v.leaderstats.XP.Changed:connect(function(z)
v.leaderstats.XP.Value = v.leaderstats.XP.Value + 25 * workspace.Scripts.Multiplier.Value
end)
end
end
end
Because when i test i get 19:40:47.528 - Maximum event re-entrancy depth exceeded for IntValue.Changed 19:40:47.529 - While entering function defined in script 'Players.Player1.PlayerGui.DoubleXP', line 5

3 comments
Can anyone solve this?
It's because when you Change the XP amount, you're changing the XP amount in that function, which once again is firing the XP Changed event, then it will change the XP value and run the event again. This becomes a loop which gets broken by your error.
I guess you could use a debounce to fix this.