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 move a tool into a player's model?

I know I can manually put a tool into my Player's Model and the player will equip it, but how can I put the tool into the Player's Model on the click of a button?

1 comment

0

I've edited my answer.

1 answer

Well, since you haven't attempted to script this, or at least haven't shown it, I'll just give you some pointers and an empty script. If it's a physical button, you'd need to insert a ClickDetector into the part. To detect when it's clicked, you'd need to use the MouseClick event. Here's a script you'll have to fill in:

tool = game.ServerStorage.Tool

script.Parent.ClickDetector. -- fill in the rest here, for the MouseClick event!
	tool:clone().Parent = -- fill it in!
end)

The Wiki does have a sample script, as well as an explanation here

If it's a GUI Button, you'd need to use the MouseButton1Click event or the MouseButton1Down event. It's sort of the same concept as a physical button, except you can make it a local script!

script.Parent.MouseButton1Click:connect(function()
	game.Lighting.Tool:clone().Parent = game.Players.LocalPlayer.Character
end)

2 comments

0

It's not a physical button, so I'll go and put it in my Screengui Button instead.

0

Ah, Let me edit my answer.

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