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
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
| |
|
|
| 25 Feb 2012 08:44 AM |
You need another end.
† KMXD † |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|