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

How do I make a tool giver?

You know, like if a player touched this thing it would give them a gun or sword or hammer. How would I be able to do that?

2 answers

Well, first you'd need the basic parts, a brick a player can touch, and a tool to give.

part = Workspace.Part
tool = game.ReplicatedStorage.Tool	-- replace with weapon-path

part.Touched:connect(function(hit) --When the [part] is Touched, trigger.

	if game.Players:FindFirstChild(hit.Parent.Name) then -- check if is a player

		local player = game.Players[hit.Parent.Name]

		tool:Clone().Parent = player.Backpack

		-- make clone of tool, and give it to the player
	
	end

end)

4 comments

0

Where do I put the weapon again?

0

Line 02, as the comment says, replace with the weapon-path.

0

Whats the Weapon Path? Is in It the device? Or do you want me to put the name of the item in it.

0

As I said.... You make the tool, put it where ever you wish, (ReplicatedStorage is probably best), then just path is as 'tool'...

Try using a model for that one or just make the tool regen :)

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