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 » Scripters
Home Search
 

Re: Whats wrong with my Gun Shop Script

Previous Thread :: Next Thread 
NeymarBarcelonaJr is not online. NeymarBarcelonaJr
Joined: 12 Aug 2009
Total Posts: 372
21 Nov 2014 10:30 PM
local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
-- Check the player has a stats object
local stats = player:FindFirstChild('leaderstats')
if not stats then return end

-- And that the stats object contains a Credits member
local credits = stats:FindFirstChild('Credits')
if not credits then return end

if choice == script.Parent.DialogChoice.Thermals then
if credits.Value >= 50 then -- value is the amount of Credits you need to purchase this weapon
game.ReplicatedStorage.Thermals:Clone().Parent = player.Backpack
credits.Value = credits.Value - 50 -- subtract the amount of Credits you need to purchase
end
elseif choice == dialog.DialogChoice.Z6 then
if credits.Value >= 50000 then
game.ReplicatedStorage.Z6:Clone().Parent = player.Backpack
credits.Value = credits.Value - 50000
end
elseif choice == dialog.DialogChoice.DC17M then
if credits.Value >= 500 then
game.ReplicatedStorage.DC17M:Clone().Parent = player.Backpack
credits.Value = credits.Value - 500
end
elseif choice == dialog.DialogChoice.DC15S then
if credits.Value >= 250 then
game.ReplicatedStorage.DC15S:Clone().Parent = player.Backpack
credits.Value = credits.Value - 250
end
end
end)


Problem : It only allows a person to buy only 2 weapons(Any) then the gun shop doesnt allow to let the user buys another.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
22 Nov 2014 12:39 AM
Check your mulas, do you have enough cash for next item?
Report Abuse
NeymarBarcelonaJr is not online. NeymarBarcelonaJr
Joined: 12 Aug 2009
Total Posts: 372
22 Nov 2014 01:30 AM
Yeah I have more than enough.It only allows purchase to be made twice per person
Report Abuse
NeymarBarcelonaJr is not online. NeymarBarcelonaJr
Joined: 12 Aug 2009
Total Posts: 372
22 Nov 2014 09:12 AM
Could there be a difference if Placed it in Lighting instead of ReplicatedStorage?
Report Abuse
MrEpic534 is not online. MrEpic534
Joined: 12 May 2012
Total Posts: 1349
22 Nov 2014 09:24 AM
any output by any chance?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
22 Nov 2014 01:52 PM
Yes it's a problem if you placed it in lighting instead of ReplicatedStorage silly..

When the script indexes REPLICATEDSTORAGE you don't store it in LIGHTING

c;
Report Abuse
NeymarBarcelonaJr is not online. NeymarBarcelonaJr
Joined: 12 Aug 2009
Total Posts: 372
25 Nov 2014 06:26 AM
I meant if I change the REPLICATEDSTORAGE to Lighting aswell. Will the same problem Occur?

-Sorry for the late reply.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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