generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Owner Hat Script

Previous Thread :: Next Thread 
Burdhouse is not online. Burdhouse
Joined: 01 Mar 2009
Total Posts: 132
23 May 2016 03:14 AM
Is there any way to make a script where a specific person joins the game and it adds a hat onto the character? Thanks for your help, I am pretty new to scripting so I don't really know how to do much yet.

-Burdhouse
Report Abuse
Burdhouse is not online. Burdhouse
Joined: 01 Mar 2009
Total Posts: 132
23 May 2016 03:16 AM
By the way I don't mind if it takes the hat from lighting or if it uses the hat ID, I could do either.

-Burdhouse
Report Abuse
Fjalon is not online. Fjalon
Joined: 03 Feb 2016
Total Posts: 1550
23 May 2016 03:16 AM
Maybe you put the hat in the starter pack or starter player?
Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
23 May 2016 03:20 AM
without FE you could have a script like this:

#code game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local hat = game.ServerStorage.(Hatname):Clone()
hat.Parent = character
end)
end)



Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
23 May 2016 03:23 AM
You can use it with FE sorry, I was going to write it in a localscript but this is easier and can be done with and without FE


Report Abuse
2760169 is not online. 2760169
Joined: 17 May 2016
Total Posts: 2
23 May 2016 04:13 AM
dont work
Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
23 May 2016 04:16 AM
Post what you copied and pasted.


Report Abuse
GuestTrooper5 is not online. GuestTrooper5
Joined: 07 May 2012
Total Posts: 38
23 May 2016 04:35 AM
After doing this it gives me a hat but it also gives everyone else a hat.

-Burdhouse
Report Abuse
GuestTrooper5 is not online. GuestTrooper5
Joined: 07 May 2012
Total Posts: 38
23 May 2016 04:36 AM
Whoops, forgot to log into my main before posting that.
Report Abuse
LetterSlayer is not online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
23 May 2016 04:40 AM
game.Players.PlayerAdded:connect(function(player)
if player.Name == (yourname) then
player.CharacterAdded:connect(function(character)
local hat = game.ServerStorage.(Hatname):Clone()
hat.Parent = character
end
end)
end)

That should work, too lazy to test it right now tho.


Loading. . . . .
Report Abuse
GuestTrooper5 is not online. GuestTrooper5
Joined: 07 May 2012
Total Posts: 38
23 May 2016 04:42 AM
I am going to make a few minor tweaks to what the previous person gave me, if that doesn't work then I'll be sure to use that.

-Burdhouse
Report Abuse
Burdhouse is not online. Burdhouse
Joined: 01 Mar 2009
Total Posts: 132
23 May 2016 04:47 AM
Doesn't seem to work, it was complaining about there being parenthesis around the hat name and didn't work with them there so I removed them and it still didn't work.

-Burdhouse
Report Abuse
Burdhouse is not online. Burdhouse
Joined: 01 Mar 2009
Total Posts: 132
23 May 2016 04:52 AM
By the way it requests an identifier when the parenthesis are there and wants there to be an end on line 3 without them.

-Burdhouse
Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
23 May 2016 04:57 AM
game.Players.PlayerAdded:connect(function(player)
if player.Name == YOURNAAME then
player.CharacterAdded:connect(function(character)
local hat = game.ServerStorage.HATNAME:Clone()
hat.Parent = character
end
end)
end)


Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
23 May 2016 04:57 AM
local owner = game.CreatorId
local nameOfHat = "DominusEmpyreus"

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
local head = chr:WaitForChild("Head")
game.ServerStorage[nameOfHat]:Clone().Parent = head
end)
end)

put this in serverscriptservice and put the hat in serverstorage


#code R+ | local RAP = "R$509,953"; local robux = "R$14,211"
Report Abuse
GuestTrooper5 is not online. GuestTrooper5
Joined: 07 May 2012
Total Posts: 38
23 May 2016 05:06 AM
Thanks abstract!
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
23 May 2016 05:09 AM
welcome

everyone else was not working lol


#code R+ | local RAP = "R$509,953"; local robux = "R$14,211"
Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
23 May 2016 05:14 AM
mine was working lol, i even tested it...


Report Abuse
2760169 is not online. 2760169
Joined: 17 May 2016
Total Posts: 2
23 May 2016 05:43 AM
still dont work
Report Abuse
Burdhouse is not online. Burdhouse
Joined: 01 Mar 2009
Total Posts: 132
23 May 2016 06:01 AM
Okay so I thought it was working and it turns out it isn't. There aren't any script errors or anything, its just kind of does nothing and sits there like a rock. I tested it with the command runner thing on the server log and it literally did nothing.

-Burdhouse
Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
23 May 2016 06:46 AM
Change "416828455" to the id of the hat you'd like to wear.

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if plr.Name == "Player1" or plr.Name == "Burdhouse" then
game:GetService("InsertService"):LoadAsset(416828455):GetChildren()[1].Parent = char
end
end)
end)


-Briicks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image