I need to change the textlabel to the current pet multiplier value as it is equipped.
ok, so that means when you equip the pet, a multiplier value changes inside the player on the server right? Your script with the loop should work although it is just not a good idea for performance. To use the change function all you need to do is reference the object with the value.
yourObjectValue.Changed:Connect(function() -- the object has to be with the value that is changing
text = "" -- the text
end)
The textlabel dont even work now and its not changing the value on the server side.
Well then your issue isn’t even the textlable. You need to make it so the value changes and your initial problem was the textlable. The Changed only makes it so whenever the object changes the function runs. If when you join it doesn’t change, then it obviously doesn’t fire so you could probably change it first then put the function. As for the value not changing, that means your script for the multiplier doesn’t work. Are there any errors? You should’ve made it more clear on what you wanted to do. I don’t think there is any way anyone can help if you don’t explain clearly.
No errors at all am i doing it wrong?
if Folder.Equipped.Value == false then
Player.PetEffect.Multi.Value += Folder.Multiplier1.Value --PET MULTIPLIER
if Player.PetEffect.Multi.Value < 0 then
Player.PetEffect.Multi.Value = 1
Player.PetEffect.Multi.Value.Changed:Connect(function()
Player.PlayerGui.Main.PetInventory.MainFrame.Purple.TextLabel.Text = Folder.Multiplier1.Value
end)
end
Well, there should be an error I spotted, I am not sure how you haven’t gotten any. Do you have the console open? Anyway, as I see you put Multi.Value.Changed, but that’s not how you use the Changed function. You need to reference the object, not a property. What you need to do is Multi.Changed or you could use GetPropertyChangedSignal and put the property Value. It is explained in the devhub link I put before. But the Changed should work as well.
Tried both doesnt work no errors in the output at all
Maybe because you have an if statement before the function? I don’t think it can run since at first it is probably true or something. Otherwise I don’t know how you wouldn’t get any errors… Maybe if you have them turned off from the otuput. It should be “All messages” by default. Otherwise I don’t know.
No its just weird idk, output is on all messages
I fixed it i just had to this
Folder:WaitForChild("Multiplier1"):GetPropertyChangedSignal("Value"):Connect(function()
Player.PetEffect.Multi.Value += Folder.LevelIncrement.Value
end)