FlameYeti
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 22158 |
|
|
| 07 Oct 2014 07:56 PM |
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue",leaderstats) cash.Name = "Cash" cash.Value = 30
script.Parent.DialogChoiceSelected:connect(function(player,theDialog) print(player) print(theDialog) if theDialog.Name == "Accept" and player.cash.Value > 49 then local s = game.ServerStorage.ClassicSword:clone() s.Parent = player.Backpack player.cash.Value = player.cash.Value - 50 elseif player.cash.Value < 50 then theDialog.ResponseDialog = "Sorry, you don't have enough" elseif theDialog.Name == "Decline" then print("Your loss") end end end)
Doesnt work. |
|
|
| Report Abuse |
|
|
FlameYeti
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 22158 |
|
| |
|
FlameYeti
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 22158 |
|
| |
|
|
| 07 Oct 2014 10:14 PM |
"Doesn't work" Give us the output, what it does, does not, and is supposed to do.
Also, don't use "> 49" Use ">= 50" |
|
|
| Report Abuse |
|
|
FlameYeti
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 22158 |
|
|
| 08 Oct 2014 07:26 AM |
| The output says cash is a nil value. |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2014 07:51 AM |
The stack trace would be helpful too.
But "cash" is never named "cash" so you can't find "parent.cash.value". Just do "cash.value", or name it "cash". |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2014 07:52 AM |
Besides that, even if it was named cash, it is parented to leaderstats right?
so you would have to do "player.leaderstats.cash.value" instead of "player.cash.value". |
|
|
| Report Abuse |
|
|