Attempt to index number with changed

I’m trying to make it so that this GUI auto updates to your BUX(game currency) once its updated

script:

game.Players.PlayerAdded:Connect(function(plr)
	local plrdata = game.Lighting.plrdata:WaitForChild(plr.Name)
	plrdata.Value.Changed:Connect(function(val)
		plr.PlayerGui.MainGame.Base.Upframe.cash.Text = plrdata.Value.."Bux"
	end)
end)

however it gives me this error:

6 Likes

you dont need .Value there. remove it and tell me if it works or not

16 Likes

jesus you are a lifesaver… :heart:

1 Like

Just curious, why is your player leaderstats data in Lighting :rofl:

13 Likes