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: Check then give..

Previous Thread :: Next Thread 
GUESTHAXX is not online. 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
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
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 is not online. 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 is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
11 Dec 2012 10:43 PM
bump
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
11 Dec 2012 10:46 PM
Did you forget another '=' sign...?
y'know since it's comparing values.... :c
Report Abuse
GUESTHAXX is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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
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