You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I want to be able to update the value (string) according to the position. (simple example : think of a global leaderboard and its update mechanic it should always update in 10 mins)
What is the issue?
It doesn’t update after it gets set once.
What solutions have you tried so far?
I have tried to loop and look up on updating the values in DevForum.
It’s an oversimplified and small script to connect to another script.
local button = script.Parent.C
local BPosition = button.Position
while true do
wait(0.1)
print("Ok Works (ValueS)")
game.ReplicatedStorage.PositionValue.Value = button.Position.X.Scale
end
If you can help me it would be great.
Thanks!
Note : No errors in the output.
Notice : I won’t reply to much of the thread because of the discussion it sparked instead I’ll mark the solution but I’ll try the solutions you guys replied with.
How are you checking the value to see if it changes? Are you checking it in the Explorer menu? Or are you checking it on a TextLabel? Is this a LocalScript or a Server Script?
Just a side note, but this isn’t really good practice
There’s a Event for these specific Instances which will keep detecting the change whenever you want it to, it’s more efficient than having to do a while wait() do loop (Which isn’t that accurate, especially if you do it by a low number)
Where is this script exactly located specifically?
Whenever you try & edit UI on the Server, it will not replicate to the client as you are using a Server Script, so in reality it would actually be changing from the Server’s standpoint and not a LocalScript (From your standpoint)
Try changing it to a LocalScript, and replace your code with this:
local button = script.Parent.C
local BPosition = button.Position
print("This should work, but just to double check we'll go ahead and print this")
local function ChangeValue()
print("This function has fired")
game.ReplicatedStorage.PositionValue.Value = button.Position.X.Scale
end
button.Position.X:GetPropertyChangedSignal("Scale"):Connect(ChangeValue)
ChangeValue()