hi, my script is alaway using old value but idk why it's alaway print "" even when i change the value of the string value
while true do game:GetService("RunService").Stepped:wait() plr = game.Players:FindFirstChild(script.Parent.plr.Value) print(script.Parent.plr.Value) if game.Players:FindFirstChild(script.Parent.plr.Value) then if plr.Character ~= null then script.Parent:Sit(plr.Character.Humanoid) end end end
This might be a solution.
while true do wait(1) game:GetService("RunService").Stepped:wait() plr = game.Players:FindFirstChild(script.Parent.plr.Value) print(script.Parent.plr.Value) if game.Players:FindFirstChild(script.Parent.plr.Value) then if plr.Character ~= nil then script.Parent:Sit(plr.Character.Humanoid) end end end
You wrote null instead of nil. You also need a wait otherwise it can crash the whole server. This should work now but comment if it does not. This is all i can think of. Hope this helps!