10 GetPropertyChangedSignal events or a .5 second loop?

Should I have 10 Value GetPropertyChangedSignal events on the client or a single .5 second loop?

Benefit of the .5 second loop is that I can make a status system inside and I won’t have to worry about researching a new method

If your asking why I need 10 GetPropertyChangedSignal Events, it’s to display stats and other things.

Could you give us more info? I’m personally not sure about what your trying to get at…

Would it be more efficient to have 10 GetPropertyChangedSignal events or a 0.5 second loop?

(on the client)

But for what?

are you saying about RBXSciptConnections or something custom

Probably the GerPropertyChangedSignal event, so it fires every time the value is changed.

1 Like

I’d use Events instead of loops: while true do loop or repeat until false or for i = #,#.

“If your asking why I need 10 GetPropertyChangedSignal Events, it’s to display stats.”

The GetPropertyChangedSignal event.

What stats? You should go more in depth instead of making a lack luster post, I don’t think many people understand what your getting at.

1 Like

Instance | Roblox Creator Documentation Should help you understand what I am referring to.

That makes it much easier to understand.

Defiantly use GetPropertyChangedSignal, note that you can only use this on instances, and not variables in a script.

That’s… what I said like in the title and description of my post? I used the word “GetPropertyChangedSignal” 3 times in my original post.

Thanks for the suggestion regardless!

One of GetPropertyChangedSignal’s most common uses is to display an player’s stats on the client. You use it on a NumberValue inside the player’s data.

For more information about stats check out:

One example is:

data.NumberValue:GetPropertyChangedSignal("Value"):Connect(function()
	textlabel.Text = data.NumberValue.Value
end)

For more information you can check out what a “TextLabel” means on Roblox and it’s uses.

I already know what these both do, yes, but I’m slightly confused on the question

Use the 0.5s loop because what you are doing is polling and it will be easier to maintain the polling loop over time. Also polling gives you a chance to consider how various stats may interact or influence one another. With signals, you will probably have to reference other properties anyway in order to determine how the stat should be updated. Signals, on the other hand are better for triggering state driven things.

In sumarry: use a loop when polling, use a signal when you need to trigger an event

One of the ways I use a status system is to handle stuns, reason why I don’t just do “player stunned = true, wait(3) stunned = false” is because I want stuns to stack, if there’s several people attacking you I don’t want their stuns to cancel each other out.

One of the ways I solved this was having a basic loop running on the client, the client has full control of their physics so I realized it didn’t matter if I handled this on the client. I can’t seem to figure out how using GetPropertyChangedSignal can avoid this.

A more “efficient” (if you can even call it that) is having a stun function is basically just constantly setting it to true until the stun ends.

function = (stun time,…)
stun = true
while stunned = true do
stun = true
task.wait(.1)
end
stun = false

(This post better describes what I meant)

The reason why I brought up the idea of a 0.5s loops is because my game isn’t too heavy on the PVP side of things, I would naturally use RunService but I figured if I wanted to use a loop I might as well put several other things inside it.

You should use 10 GetPropertyChangedSignal events, as it’s more performant and reacts quicker than a .5 loop.