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
 

How do the KOs not go away?

Previous Thread :: Next Thread 
Pexur is not online. Pexur
Joined: 23 Jun 2008
Total Posts: 12779
16 Mar 2014 01:59 PM
ShopBrick = script.Parent
local debounce = false
price = 0 --Put the price here.
Stat = "KOs"
tool = "LinkedSword"

function onTouched(hit)
if (debounce == false) then
if (hit.Parent:findFirstChild("Humanoid") ~= nil) then
local human = hit.Parent:findFirstChild("Humanoid")
if (game.Players:findFirstChild(hit.Parent.Name) ~= nil) then
local player = game.Players:findFirstChild(hit.Parent.Name)
if (player:findFirstChild("leaderstats") ~= nil) then
local stats = player:findFirstChild("leaderstats")
if (stats:findFirstChild(Stat) ~= nil) then
local stat = stats:findFirstChild(Stat)
if (stat.Value >=price) then
stat.Value = stat.Value - price
if (player:findFirstChild(tool) == nil) then
game.Lighting:findFirstChild(tool):clone().Parent = player.StarterGear
game.Lighting:findFirstChild(tool):clone().Parent = player.Backpack
debounce = true
ShopBrick.BrickColor = BrickColor.new("Bright red")
wait(2)
ShopBrick.BrickColor = BrickColor.new("Bright green")
debounce = false
end
end
end
end
end
end
end
end
Report Abuse
Pexur is not online. Pexur
Joined: 23 Jun 2008
Total Posts: 12779
16 Mar 2014 02:00 PM
It's like a tycoon button. Once it's hit your money goes away, but I don't want it to do that.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
16 Mar 2014 02:00 PM
Remove this line:

stat.Value = stat.Value - price
Report Abuse
Pexur is not online. Pexur
Joined: 23 Jun 2008
Total Posts: 12779
16 Mar 2014 02:01 PM
Thanks
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