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: Not sure why this is breaking.

Previous Thread :: Next Thread 
CrakTehRaven is not online. CrakTehRaven
Joined: 05 Mar 2010
Total Posts: 1471
25 Aug 2013 12:40 AM
shield.Touched:connect(function(part)
if not part then return end
if not part.Parent then return end
plrname = part.Parent.Name
convict = game.Players:FindFirstChild(plrname)
if convict:FindFirstChild("Humanoid") then
ctme = convict:FindFirstChild("ctime")
if ctme ~= nil then
if convict.TeamColor == BrickColor.new("White") or convict.TeamColor == BrickColor.new("Bright yellow") then
ctme.Value = jailtime
end
end
end
end)

------------------------------------------------------

Line 4, attempt to access global convict, nil value.

Assume that ctime exists within the player.
Report Abuse
CrakTehRaven is not online. CrakTehRaven
Joined: 05 Mar 2010
Total Posts: 1471
25 Aug 2013 12:41 AM
Also assume that jailtime exists.

This is just a portion of a piece of code.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
25 Aug 2013 12:42 AM
convict is nil.
Report Abuse
CrakTehRaven is not online. CrakTehRaven
Joined: 05 Mar 2010
Total Posts: 1471
25 Aug 2013 12:43 AM
Alright, now, a solution would be nice.
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
25 Aug 2013 12:45 AM
Are you allowed to have many ands in an if statement if so then that would fix all ur problems.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
25 Aug 2013 12:45 AM
ch = part.Parent
convict = game.Players:GetPlayerFromCharacter(ch)
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
25 Aug 2013 12:45 AM
Can you have many and's in an if statement if so then that would fix all your errors.
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