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: Help me modify this script!

Previous Thread :: Next Thread 
Emperoar is not online. 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 is not online. 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
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
12 Aug 2014 01:28 PM
Yep, that's probably the solution.
Report Abuse
wazap is not online. 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 is not online. Vescatur
Joined: 18 Feb 2012
Total Posts: 3426
12 Aug 2014 01:31 PM
its not a localscript, I think
Report Abuse
Emperoar is not online. 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 is not online. 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
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
12 Aug 2014 01:40 PM
You can use local in any script, I Always use local, in any script...
Report Abuse
darthpyro is not online. 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
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