GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 11 Dec 2012 10:02 PM |
Gui shop button..
gui = script.Parent
gui.MouseEnter:connect(function() script.Parent.Parent.Parent.Image.ItemName.Text = "Mac & Cheese" script.Parent.Parent.Parent.Image.ItemInfo.Text = "HP +2/sec" script.Parent.Parent.Parent.Image.ItemPrice.Text = "20 Sierra Madre Chips" end)
gui.MouseButton1Down:connect(function() if plr.leaderstats ~= nil then plr.leaderstats.Chips.Value = 0 then script.Parent.Parent.Parent.Image.ItemInfo.Text = "Not enough money." else plr.leaderstats.Chips.Value = plr.leaderstats.Chips.Value = -20 local p_LOCAL = game:GetService("Players")[player.Name] game.Lighting.MacCheese:Clone().Parent = p_LOCAL.BackPack end end end)
No matter how many equals or what else I put in line 11 I get a "=" expected near "==" error..
line 11 plr.leaderstats.Chips.Value = 0 then
Also, I think I'm doing this wrong.
|
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 10:03 PM |
plr.leaderstats.Chips.Value = 0 then
You're either missing an 'if' or your 'then' doesn't need to be there.
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]- |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 11 Dec 2012 10:14 PM |
Add an if..
Players.Player1.PlayerGui.Shop.Frame.ItemList.Mac & Cheese.Script:11: 'then' expected near '='
So now what? |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
|
| 11 Dec 2012 10:46 PM |
Did you forget another '=' sign...? y'know since it's comparing values.... :c |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 11 Dec 2012 11:50 PM |
| maybe.. but If I add another = sign then I wouldn't be able to buy anything unless I have 0 chips right? |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 11:58 PM |
Well um, that's what the else statement is for right... I think you need the '==' sign to fix dat error in output :x |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 12 Dec 2012 12:02 AM |
ok... test it then...
Yayz...
00:01:51 - Players.Player1.PlayerGui.Shop.Frame.ItemList.Mac & Cheese.:6: attempt to index global 'plr' (a nil value) 00:01:51 - Script "Players.Player1.PlayerGui.Shop.Frame.ItemList.Mac & Cheese.", Line 6 00:01:51 - stack end
? |
|
|
| Report Abuse |
|
|