Stage Selector not changing

So, the stage selector wasnt changing when i reach the other checkpoint. im not very good in scripting and so is my builder. were trying to figure out how to make it change when i reach the other checkpoint but we couldnt.

heres the script that i use

 wait(2)

local player = game.Players.LocalPlayer
local currentStage = player.CurrentStage

while wait() do
script.Parent.Text = tostring(currentStage.value)
end

thanks for your feedback

While I’m not sure as to exactly why this doesn’t work, but It could be some problem as it’s not able to find it, etc. here is a script that should work (although yours should work too):

local player = game.Players.LocalPlayer

repeat 
wait()
until player:FindFirstChild("CurrentStage")

local currentStage = player.CurrentStage

currentStage:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.Text = tostring(currentStage.Value)
end)

Edit: I edited it to property changed signal as it was pointed out I had it wrong there :sweat_smile:

1 Like

This wouldn’t work as he’s most likely not using attributes.

1 Like

An attribute is literally Value and other things of an IntValue, NumberValue or almost any instance. Please, before commenting that something is incorrect, know what something is. Here is what I used

1 Like

No, an attribute is an attribute, a property is a property. GetAttributeChangedSignal would only work on attributes.

2 Likes

You’re looking for :GetPropertyChangedSignal. Please, before correcting people, at least read the documentation.

On the backend, properties and attributes are likely stored in different locations as, fundamentally, the entire workspace is tables

It would probably look something like this just to give a visual.

local part = {
    Color = Color3.new();
    CanCollide = false;
    Anchored = false;
 -- etc for the rest of the properties
    Attributes = {
        CoolAttribute = 1;
    }
}
2 Likes

Oh, whoops ok I admit my mistake here. Sorry about that.

2 Likes