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

Tool giver on brick touched?

Asked by
steev 0
10 years ago

When the player touches a brick they get given a tool in their tool bar.

If i could have a script for this it would answer all of my questions!

Thanks!

1 answer

Log in to vote
0
Answered by
Bloxks 30
10 years ago

You would listen to the "Touched" event, which triggers when a player touches the brick:

script.Parent.Touched:connect(function(player) -- Getting brick and defining the player.
end)

Then, all you do is insert the tools into the player.

script.Parent.Touched:connect(function(player)
    local Tool = game.Workspace.RandomTool:clone(); -- Defining a tool that will be cloned.
    Tool.Parent = player.Backpack; -- Defining the parent of the cloned tool.
end)
Ad

Answer this question