How do i make this script restart itself?

local Input = game:GetService("UserInputService")
local Delevier= game.ReplicatedStorage.Remotes.Equip
local Delevier2= game.ReplicatedStorage.Remotes.Unequip
local Bool1 = script:WaitForChild("Bools"):FindFirstChild("CoolDown").Value
local Bool2 = script:WaitForChild("Bools"):FindFirstChild("Equipped/Unequipped").Value
Input.InputBegan:Connect(function(Key)
	if Key.KeyCode == Enum.KeyCode.F and Bool1 == false and Bool2 == false then
		Bool1 = true
		Bool2 = true
		print("Sending")
		Delevier:FireServer(Bool1 , Bool2)
		wait(2)
		Bool1 = false
	else
		if Key.KeyCode == Enum.KeyCode.F and Bool1 == false and Bool2 == true then
			Bool1 = true
		print("Sending")
			Delevier2:FireServer()
			wait(2)
			Bool2 = false
			Bool1 = false
			
	end
	end
end)
1 Like

Why would this script need to restart itself? I don’t see any reason why you would need to restart the script or make it go back to the start.

Wouldn’t just enabling and disabling it work

Hey guys am sorry for the late reply but no worries i figured it out but thanks also i 've sent the wrong script

Oh, ok.

Have a good day and happy developing!

2 Likes