To explain i made a script that i can run for myself and all the features work perfectly. the only problem is that when i die or get resetted while i am running the script i cant re run it again in my next life. i dont know what exactly is the problem all i get are errors saying that the script does not contain the elements which are supposed to be in the script. please help. This is my main require script, u dont need to know the others as they already work.
local Bruh = {}
function Bruh.Give(Name)
local plr = game.Players:FindFirstChild(Name)
wait(0.5)
script.RemoteEvent.Parent = plr.Character
script.AttackScript.Parent = plr.Character
script.LocalScript.Parent = plr.Character
plr.Character.Humanoid.MaxHealth = 100000000000000000000000000000000000000000000
plr.Character.Humanoid.Health = 100000000000000000000000000000000000000000000
plr.Character.Humanoid.WalkSpeed = 50
script.ScreenGui.Parent = plr:WaitForChild("PlayerGui")
script.BanGui.Parent = plr:WaitForChild("PlayerGui")
script.Type.Parent = plr:WaitForChild("PlayerGui")
script.Chara.Parent = plr:WaitForChild("PlayerGui")
script.Classic.Parent = plr:WaitForChild("PlayerGui")
script.Dust.Parent = plr:WaitForChild("PlayerGui")
script.Error.Parent = plr:WaitForChild("PlayerGui")
script.Tut.Parent = plr:WaitForChild("PlayerGui")
script.Race.Parent = plr.Character
script.BillboardGui.Parent = plr.Character.Head
plr.Character.Race:Play()
script:Destroy()
end
return Bruh

11 comments
Please provide some more information (the errors, the lines in which they are in etc)
its not a error basically u see i have this entire script which contains alot of elements that gives me a good performance. But it cant be re runned for some reason i dont know why
to put it simply its a require script. But when i require it once it wont work again its broken
When a character dies/reset all the containers get replaced with a new one, that is why your code isn't working. Simply add a loop to fix the issue.
what does that mean?
and what u mean by loop?
A loop is something that repeats continuously.
e.g. for loop, while true do loop, repeat loops
can u post a example of a loop and why i need it?
itll help because im not really sure what do i do with a loop and why i need it
post your solved answer in answer.