Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with this script please?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
1
Answered by
Im_Kritz 334 Moderation Voter
9 years ago

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)
Ad

Answer this question