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

How do I add a hat to players?

Asked by 9 years ago

One of the various issues I am having is that I trying to figure out a way to put a "hat" on a player. I tiredly keep trying to find a way (e.g. Google, Bing, Roblox Wiki), but no yet found an answer. Please help me. I have already put the hat (Space Hat) in ServerStorage, however I don't know where to go from there. Additionally I know that I probably should add a PlayerAdded event. Am I doing anything wrong?

1 answer

Log in to vote
0
Answered by 9 years ago

This is not a request site but I will get you started.

Were gonna use a few things to do this: • CloneParent

Were gonna first make variable called hat. This variable is gonna be our hat object that is in Server Storage like you said.

hat = game.ServerStorage.Hat

Then what were going to do is were going to clone the Hat Object from Server Storage. So were going to use :clone(). It should look like this:

hat = game.ServerStorage.Hat
hat:clone()

Then what were going to do is get the player's name and change the parent of the hat object. Were gonna use the .Parent property for this.

hat = game.ServerStorage.Hat
hat:clone()
hat.Parent = game.Workspace["Player1"] -- This is an example of a player, you will need to find another way to find the player.

After you have changed the .Parent you should be done. Lets take a overview, you defined the hat. You cloned the hat object and then you changed its parent to the player.

If this helped you please accept this answer.

Ad

Answer this question