I'm trying to make a script that prints the value of a StringValue that will change, but I'm to immature on Lua

1 Like

Add wait(5) to standValue and see if it needs to wait.

30 chars…

It’s still printing “Fists”, which is not working.

Ohhh, you’re messing around with my brain. Tell me what you want to make.

I want my script to print the value inside the StringValue called “StandValue”

The value will change from time to time. Which, the script execution system in Roblox will just keep printing the old value.

game.ReplicatedStorage.StandPunch.OnServerEvent:Connect(function(plr)
      while true do
          wait(1)
          if plr:WaitForChild("StandValue").Changed then
                 print(plr:WaitForChild("StandValue").Value)
          end)
      end
end)

@R3tr0_Alit0

It’s still not working with that method you’ve told me. It makes a loop.

While true do is a Looping Method.

1 Like

Yeah I wanted it to check every 1 second if it had changed.

Well it didn’t.
If that answers your question.

1 Like