|
| 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
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 06 Dec 2011 10:49 AM |
if g == "Amo" then
if g.Name == "Amo" then
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|