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: RPG Shop - how to limit sales

Previous Thread :: Next Thread 
isaacfrye is not online. isaacfrye
Joined: 12 Jul 2008
Total Posts: 230
15 Aug 2012 09:38 PM
I am working on a Skyrim game with treasure chests, ofcourse
everything found in chests are free to take, it works exactly
like a shop except being free, so the thing I need to know, is how
to edit this script so it limits the buyer to only one. or if maybe it is only
possible through editing a different script, or making another one? I don't
know, but I would appreciate all the help I can get.

player = script.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.gold -- Change Gold to the money you want to be used to buy the item
price = 0 -- Your price goes here
tool = game.Lighting:findFirstChild("iron dagger")


_____________________________________________
player = script.Parent.Parent.Parent.Parent.Parent
money = player.leaderstats.goldused to buy the item
price = 0
tool = game.Lighting:findFirstChild("iron dagger")


function buy()
if money.Value >= price then
money.Value = money.Value - price
local a = tool:clone()
a.Parent = player.Backpack
local b = tool:clone()
b.Parent = player.StarterGear

end
end
script.Parent.MouseButton1Down:connect(buy)
_____________________________________________
Report Abuse
isaacfrye is not online. isaacfrye
Joined: 12 Jul 2008
Total Posts: 230
15 Aug 2012 09:39 PM
ignore that little double post, read only the script part
in the box
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
15 Aug 2012 10:06 PM
Check the players Backpack for the sword when they try to buy it. If they have it, break.
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
15 Aug 2012 10:07 PM
And if its free you don't need the price lol.
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
15 Aug 2012 10:10 PM
Wait, this is a Gui? Mind explaining a little further on how you are aquiring this chest? Do you touch at and get a Gui?
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