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

How do I make a tool giver?

Asked by
EpicLilC 150
10 years ago

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

Log in to vote
0
Answered by
hiccup111 231 Moderation Voter
10 years ago

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)

0
Where do I put the weapon again? EpicLilC 150 — 10y
0
Line 02, as the comment says, replace with the weapon-path. hiccup111 231 — 10y
0
Whats the Weapon Path? Is in It the device? Or do you want me to put the name of the item in it. EpicLilC 150 — 10y
0
As I said.... You make the tool, put it where ever you wish, (ReplicatedStorage is probably best), then just path is as 'tool'... hiccup111 231 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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

Answer this question