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

Events for changed?

Ive done

player.Values.XP.Changed:connect(Update())
player.Values.Gold.Changed:connect(Update())
player.Values.Level.Changed:connect(Update()) -- There are about 12 more

is there a way I can make it one...

2 comments

0

Can you please ask clearer?

0

instead of multiple connects is it possible to make it one i dont mind using for loops but it will be a pain to change it if i decide to remove or add anything

1 answer

✓ Accepted answer

Maybe try this, it will run a loop though all the player values and if any of them change the event will run.

pv = player.Values:GetChildren()

function Update()
--Code here
end

for i=1,#pv do
pv[i].Changed:connect(Update()) --I am not sure if you can have a connection tell the function information... I was reluctant on having the parenthesis in there.
end

1 comment

0

i dont need args so thank you

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