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 » Scripters
Home Search
 

Re: Quick fix?

Previous Thread :: Next Thread 
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
25 Nov 2014 04:47 PM
I'm sure you guys would have a better idea on this than I do. This script has been wrote for me but I'm not sure whats up. It adds a tool to both a users backpack and starterpack and checks if they already have it. If they already have it then it will not be added.

function onTouched(part)
p = game.Players:playerFromCharacter(part.Parent)
if p == nil then return end
Wep2 = game.Lighting.Pistol-(12):clone()

if p.StarterGear:findFirstChild(Wep2.Name) ~= nil then return end
Wep2.Parent = p.StarterGear

Wep2 = game.Lighting.Pistol-(12):clone()
if p.Backpack:findFirstChild(Wep2.Name) ~= nil then return end
Wep2.Parent = p.Backpack
end

script.Parent.Touched:connect(onTouched)

My issue here is that this is the second time it is used in my game and is not working. I am assuming this is down to it registering the player as already having the item from the previous time it is used. I have changed it to "Wep2" assuming that would fix the problem but it hasn't. My only thought is that because the tool name has the updating ammo count in it then it might be messing with it.

In short, I tried and now I'm stuck. Anyone know whats up?

Thanks.
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
25 Nov 2014 08:07 PM
bump
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
25 Nov 2014 08:08 PM
".Pistol-(12)"
Hyphens are not allowed for keys in this format, and neither are parentheses.
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
26 Nov 2014 05:11 PM
So my hunch of the name messing with it was correct? Thats oddly encouraging. So, new problem, does anyone know how I could work around this issue? Any ideas?

Also, thank you for the help. Much appreciated.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
26 Nov 2014 05:15 PM
Use ["Pistol-(12)"] instead of .Pistol-(12)
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
14 Dec 2014 05:14 AM
I am afraid this did not fix it. If anyone can offer anymore insight that would be great.
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
14 Dec 2014 09:01 AM
Bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
17 Dec 2014 05:10 AM
Again bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
19 Dec 2014 12:11 PM
Bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
21 Dec 2014 11:54 AM
Bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
24 Dec 2014 10:20 AM
Bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
27 Dec 2014 09:07 AM
Bump
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
03 Jan 2015 01:14 PM
Anyone?
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
05 Jan 2015 05:18 PM
Can seriously no one help with this?
Report Abuse
BelowMetro is not online. BelowMetro
Joined: 30 May 2010
Total Posts: 3691
27 Jan 2015 01:08 PM
Please could someone help me out with this?
Please
Pretty please
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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