Emperoar
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 382 |
|
|
| 12 Aug 2014 01:11 PM |
Things I need help fixing: 1. Player doesn't respawn when GUI is clicked 2. Hat is lower on the head (it's halfway up the character's head atm)
Any ideas on how to fix these problems?
plr = script.Parent.Parent.Parent.Parent.Parent
function onButtonClicked() plr:LoadCharacter() plr.CharacterAdded:connect(function(char) hat = Instance.new("Hat",plr.Character) hat.Name = "DeleteFalse" handle = Instance.new("Part",hat) handle.Name = "Handle" mesh = Instance.new("SpecialMesh",handle) mesh.MeshId = "http://www.roblox.com/asset/?id=33364735" mesh.TextureId = "http://www.roblox.com/asset/?id=33513530" hat.Handle.CFrame = plr.Character.Head.CFrame * CFrame.new(0, plr.Character.Head.Size.Y / 2, 0) * hat.AttachmentPoint:inverse() script.Parent.Parent.Visible = false end) end script.Parent.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
Paralyo
|
  |
| Joined: 24 Dec 2012 |
| Total Posts: 27 |
|
|
| 12 Aug 2014 01:17 PM |
I don't know much, but:
Try putting "local" in front of every variable you set. This makes sure that ROBLOX knows what you mean all the way through the script. Once again, that was just a guess. It could be anything. Sorry. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2014 01:28 PM |
| Yep, that's probably the solution. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 12 Aug 2014 01:30 PM |
:LoadCharacter() is a no-no in a localscript
We must be swift as a coursing river- With all the force of a great typhoon - With all the strength of a raging fire - Mysterious as the dark side of the moon |
|
|
| Report Abuse |
|
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
|
| 12 Aug 2014 01:31 PM |
| its not a localscript, I think |
|
|
| Report Abuse |
|
|
Emperoar
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 382 |
|
|
| 12 Aug 2014 01:34 PM |
It isn't a localscript. It's a regular script...
You don't use "local" if it isn't a localscript, right? |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 12 Aug 2014 01:40 PM |
| Ignore them talking about adding local modifiers. Local affects the scope, and this doesn't look like a scope problem. I'm not sure why your character doesn't respawn. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2014 01:40 PM |
| You can use local in any script, I Always use local, in any script... |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 12 Aug 2014 01:52 PM |
Using local is a completely unnecessary change and I see no reason to use it in this situation.
Try using this line, instead of 'hat.Handle.CFrame ..'
hat.AttachmentPos = Vector3.new(0, 0.25, 0.125) |
|
|
| Report Abuse |
|
|