I have a local script that works fine but after the player resets it stops working.
_G.Toggle = true
while _G.Toggle == true do
game:GetService("Players").LocalPlayer.Backpack.Combat.RemoteEvent:FireServer("comboAttack")
game:GetService("Workspace").suricato006.HumanoidRootPart.CFrame = game:GetService("Workspace").FightableNPC.ROSHIStarter.rock.HumanoidRootPart.CFrame wait()
end
now the script is supposed to spam teleport the player and making it attack automatically but it doesnt work when he resets. The problem that i think it can be is the fact that the Character model re-builds when the player dies so there is no HumanoidRootPart and the script stops working cause it errors. How can i fix it? I tried putting a game.Workspace.suricato006:WaitForChild("HumanoidRootPart") but still.
