The following code is inserted into the player when they join, it is copied from the serverstorage, however the code never runs!
Here is the code:
local player = script.Parent local playerfolder = game.Workspace:FindFirstChild(player.."Time") local playertime = playerfolder:FindFirstChild("PlayerElapsedTime") local playertimevalue = playertime.Value while true do playetimevalue = playertimevalue + 1 print("Value Updated") wait(1) end
The code is extremely simple, but doesn't run the loop when it is placed into the player.
Any suggestions?
I think I've spotted your problem. On line 4, you added .Value
. To be honest, I don't know the exact reason for this, but I believe you should remove the .Value
from defining the variable. You would put .Value
on line 8. So..
local player = script.Parent local playerfolder = game.Workspace:FindFirstChild(player.."Time") local playertime = playerfolder:FindFirstChild("PlayerElapsedTime") while true do playertime.Value = playertime.Value + 1 print("Value Updated") wait(1) end