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: Why doesnt my script work?

Previous Thread :: Next Thread 
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
23 Aug 2011 04:47 PM
it doesnt have any output and its in a local script




function onTouched(hit)

a = game.Players.LocalPlayer
a.Character.Humanoid.Name = Zombie
end

script.Parent.Touched:connect(onTouched)
Report Abuse
ZackZak is not online. ZackZak
Joined: 26 Jul 2009
Total Posts: 2811
23 Aug 2011 04:48 PM
Strings need quotations marks around them, as well as you're not doing any checks to see if those things exist at that point in time. What if the Humanoid's name is already Zombie? What if the Character hasn't been added yet?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
23 Aug 2011 04:48 PM
Localscripts only run if they're in the Character or the Player. Nowhere else. Plus, names have to be a string.

~~{I'm a dangerous sociopath with a long history of violence}~~
~{I don't understand how you keep forgetting that}~
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
23 Aug 2011 04:48 PM
Wait, is this in a part?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
23 Aug 2011 04:48 PM
Wheres the localscript?
Report Abuse
ZackZak is not online. ZackZak
Joined: 26 Jul 2009
Total Posts: 2811
23 Aug 2011 04:49 PM
+What swim said, I forgot to mention that. :P
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
23 Aug 2011 04:55 PM
localscript is in a part in workspace
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
23 Aug 2011 04:55 PM
Read my last post

~~{I'm a dangerous sociopath with a long history of violence}~~
~{I don't understand how you keep forgetting that}~
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
23 Aug 2011 04:58 PM
When you say names, I think you need "" because its a string.
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