I am getting this error:
attempt to index global 'plr' (a nil value)
The script I have is
wait(5) local Pos = plr.Character:GetPrimaryPartCFrame() plr:LoadCharacter() plr.Character:SetPrimaryPartCFrame(Pos) if plr.Character:FindFirstChild("ForceField") then plr.Character["ForceField"]:Destroy() print("testing") end
it is supposed to refresh the character after 5 seconds than print testing
plr means nothing. the computer does not know what to think about it. you need to make it a variable.
local plr = game.Players.LocalPlayer
now, to stick that into context:
wait(5) local plr = game.Players.LocalPlayer local Pos = plr.Character:GetPrimaryPartCFrame() plr:LoadCharacter() plr.Character:SetPrimaryPartCFrame(Pos) if plr.Character:FindFirstChild("ForceField") then plr.Character["ForceField"]:Destroy() print("testing") end