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 » Scripting Helpers
Home Search
 

Im making a game how to I make all visitors have a certain hat on?

Previous Thread :: Next Thread 
darkfish900 is not online. darkfish900
Joined: 05 Mar 2010
Total Posts: 8347
27 Nov 2011 08:04 AM
What is the script?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
27 Nov 2011 08:12 AM
Have a copy of the hat in game.Lighting, and when they spawn, put the hat on them.

Give me a sec and ill make a script for you.
Report Abuse
dynamited3 is not online. dynamited3
Joined: 24 Jul 2008
Total Posts: 26
27 Nov 2011 08:14 AM
Put the hat in game.Lighting
Put this script in Workspace:
function onPlayerEntered(newPlayer)

hc = game.Lighting:findFirstChild("HAT NAME HERE"):Clone()
hc.Parent = newPlayer.Character

end
game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
27 Nov 2011 08:23 AM
local function onRespawn(character)
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Bucket Hat"
p.Parent = h
p.Position = character:FindFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(2, 1, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
game.Lighting.Hat.Mesh:clone().Parent = p
h.Parent = character
h.AttachmentPos = Vector3.new(0, 0.15, 0)
end

local function onPlayerEntered(newPlayer)
newPlayer.CharacterAdded:connect(onRespawn)
end

game.Players.PlayerAdded:connect(onPlayerEntered)

That creates a hat inside the players' character when he spawns, and then clones the hat mesh from the object 'hat' in game.Lighting.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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