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

Tool script not working?

I'm making a strategy game and you find a gun in one part, once you click it, you get it. But It won't work.

script.Parent.ClickDetector.MouseClick:connect(function()
	game.Lighting.Pistol:Clone().Parent = Backpack
	script.Parent:Destroy()
end)

Thank you for the help!

1 answer

✓ Accepted answer

This script is meant to be a child of the ClickDetector.

Pistol = game.Lighting.Pistol

script.Parent.MouseClick:connect(function(player)
	if player.Backpack:FindFirstChild("Pistol") == nil then
	x = Pistol:Clone()
	x.Parent = player.Backpack
	script.Parent.Parent:Destroy()
	end
end)

Hope this is what your looking for.

2 comments

0

It works, nice.

0

Welcome.

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