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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Tycoon Button Still Broken?

Previous Thread :: Next Thread 
iPremiumZ is not online. iPremiumZ
Joined: 23 Jan 2012
Total Posts: 6834
25 Feb 2012 08:42 AM
Upgradecost = 7500
upgradeStuff = model:clone()
upgrad = script.Parent.Parent.Parent.Upgrad

wait(0)

model:remove()
owner = script.Parent.Parent.Parent.OwnerName
local ting = 0

function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")

if check ~= nil then
if hit.Parent.Name == owner.Value then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")

if stats ~= nil then
local cash = stats:findFirstChild("Cash")
if cash.Value > (Upgradecost-1) then

cash.Value = cash.Value - Upgradecost
upgrad.Value = upgrad.Value + 0
script.Parent.Parent.Ownt.Bought.Value = script.Parent.Parent.Ownt.Bought.Value + 1
script.Parent.Parent.Owned.Bought.Value = script.Parent.Parent.Owned.Bought.Value + 1

script.Parent.Parent:remove()

end
end
end
end

ting = 0
end

end
script.Parent.Touched:connect(onTouched)
Report Abuse
C0D3Y is not online. C0D3Y
Joined: 24 Jul 2010
Total Posts: 1692
25 Feb 2012 08:43 AM
Output please.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Feb 2012 08:44 AM
You need another end.

† KMXD †
Report Abuse
iPremiumZ is not online. iPremiumZ
Joined: 23 Jan 2012
Total Posts: 6834
25 Feb 2012 08:51 AM

Upgradecost = 7500
upgradeStuff = model:clone()
upgrad = script.Parent.Parent.Parent.Upgrad

wait(0)

model:remove()
owner = script.Parent.Parent.Parent.OwnerName
local ting = 0

function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")

if check ~= nil then
if hit.Parent.Name == owner.Value then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")

if stats ~= nil then
local cash = stats:findFirstChild("Cash")
if cash.Value > (Upgradecost-1) then

cash.Value = cash.Value - Upgradecost
upgrad.Value = upgrad.Value + 0
script.Parent.Parent.Ownt.Bought.Value = script.Parent.Parent.Ownt.Bought.Value + 1
script.Parent.Parent.Owned.Bought.Value = script.Parent.Parent.Owned.Bought.Value + 1

script.Parent.Parent:remove()

end
end
end
end

ting = 0
end
end

end
script.Parent.Touched:connect(onTouched)


Still doesn't work
Report Abuse
Torcus is not online. Torcus
Joined: 22 Feb 2012
Total Posts: 885
25 Feb 2012 09:17 AM
[ Post: 54 ]

-------------------------------------------------------------------------------------------------------------------------
model = script.Parent.Parent.Parent.ModelNameHere
Upgradecost = 2100
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone()
wait(1)
model:remove()
owner = script.Parent.Parent.Parent.OwnerName
local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
if hit.Parent.Name == owner.Value then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Cash")
if cash.Value > (Upgradecost-1) then
cash.Value = cash.Value - Upgradecost
upgradeStuff.Parent = script.Parent.Parent.Parent
script.Parent.Parent:remove()
end
end
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)
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