Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with this script please?

I am trying to make a script where when you click a tool a sphere appears around you that part works and it goes away after 10 seconds as intended but the tool cant be used again help?

tool = script.Parent
Bewm = game.ServerStorage.Sphere
Bewm2 = game.ServerStorage.Sphere:Clone()

playerMouse = game.Players.LocalPlayer:GetMouse()

tool.Equipped:connect(function(eventMouse)
	
	eventMouse.Button1Down:connect(function()
		Bewm2.Parent = game.Workspace
		Bewm2.Position = tool
	end)
end)

That is the code in the tool

Bewm1 = script.Parent

wait(10)
Bewm1:Destroy()

That is the code in the sphere itself please help

1 answer

✓ Accepted answer

If you are planning on still being able to use the tool, after an amount of time then you need to use the Debris Service

So your code with be like:

Bewm1 = script.Parent

game:GetService('Debris'):AddItem(Bewm1, 10)

This discussion is preserved as it was. New answers, comments, and votes are closed.