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 script that will give someone a hat when they step on a part?

The hat id is this:

21069972

1 comment

0

This is not a request site. You will be moderated.

1 answer

All you need is a .Touched event, get the humanoid from the hit, then the character, then the player. And after that give the player the hat you want, you can copy the hat from server storage or somewhere else and put it to the player's character. Easy as that.

Link to wiki articles which can help you:

http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched

http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter

http://robloxdev.com/articles/Conditional-Statements-in-Lua (will need to check if the hit is a player)

http://wiki.roblox.com/index.php?title=API:Class/Instance/Clone

http://wiki.roblox.com/index.php?title=API:Class/Instance/FindFirstChild

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