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
 

Re: Lit hat giver

Previous Thread :: Next Thread 
Toxenz is not online. Toxenz
Joined: 22 Nov 2009
Total Posts: 4389
11 May 2013 03:07 PM
I'm essentially trying to make a headlamp. I'm just using a standard fm hat giver and inserting a spot light into the hat. But when I wear the hat the lgiht gets removed. Any way I could get the light to transefer with it?
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
11 May 2013 03:09 PM
Give us the hat giver script.


Btw, *Lit hat giver
Report Abuse
Toxenz is not online. Toxenz
Joined: 22 Nov 2009
Total Posts: 4389
11 May 2013 03:13 PM
debounce = true

function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Night Vision Goggles"
p.Parent = h
p.Position = hit.Parent: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
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, .1, 0)
wait(1)
debounce = true
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
11 May 2013 03:16 PM
insert a spotlight called "SpotLight" in the part and change the script to this

debounce = true

function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
light = script.Parent.SpotLight:clone()
h.Name = "Night Vision Goggles"
p.Parent = h
light.Parent = p
p.Position = hit.Parent: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
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, .1, 0)
wait(1)
debounce = true
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Toxenz is not online. Toxenz
Joined: 22 Nov 2009
Total Posts: 4389
11 May 2013 03:23 PM
Still didn't light the one givin to the player.
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