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

Previous Thread :: Next Thread 
pokemon46804 is not online. pokemon46804
Joined: 02 Sep 2010
Total Posts: 373
06 Dec 2011 10:43 AM
THIS IS DRIVING ME NUTS....

local Tool = script.Parent
local User
op = 0
g = script:FindFirstChild("Amo")


Tool.Equipped:connect(function(mouse)
local plr = script.Parent.Parent.Name
if g == "Amo" then
Ammo = 100
g = script:FindFirstChild("Amo")
g.TextLabel.Text = "100"
g.Parent = game.Players[plr].PlayerGui
op = 1
else
if g ~= "Amo" then
print("Gui is already opend!")
end
end
User = Tool.Parent
-- the rest of the script goes here :c



Got this on output

Gui is already opend!
11:43:23 - Workspace.Player.Tool.LocalScript:22: attempt to compare number with nil
11:43:23 - Script "Workspace.Player.Tool.LocalScript", Line 22
11:43:23 - stack end
11:43:23 - Disconnected event because of exception



Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
06 Dec 2011 10:49 AM
if g == "Amo" then

if g.Name == "Amo" then
Report Abuse
pokemon46804 is not online. pokemon46804
Joined: 02 Sep 2010
Total Posts: 373
06 Dec 2011 10:53 AM
It works but when i unequip then equip it i get this in the output


11:52:51 - Workspace.Player.Tool.LocalScript:13: attempt to index global 'g' (a nil value)
11:52:51 - Script "Workspace.Player.Tool.LocalScript", Line 13
11:52:51 - stack end
11:52:51 - Disconnected event because of exception
Report Abuse
pokemon46804 is not online. pokemon46804
Joined: 02 Sep 2010
Total Posts: 373
06 Dec 2011 11:06 AM
Nvm I fixed it.
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