of     1   

zub74
#138427098Friday, June 27, 2014 10:44 PM GMT

local dialog= script.Parent local values= script.Parent.Parent.Parent.Parent.Values dialog.DialogChoiceSelected:connect(function(player, choice) -- Check the player has a stats object local stats = player:FindFirstChild('leaderstats') if not stats then return end local Cash = stats:FindFirstChild('Cash') if not Cash then return end if choice == script.Parent.Building.Panel1 then if values.Panel1.Value==false then if Cash.Value >= 500 then values.Panel1.Value=true Cash.Value = Cash.Value - 500 elseif Cash.Value <=500 then script.Parent.Building.Panel1.ResponseDialog=("Sorry, you don't have the cash!") end end end end) Looks fine, no errors in output... But it acts as if cash is always at or above 500. Even when cash is obviously lower than 500, it still doesn't properly change the dialog. Did I mess something up?
zub74
#138427435Friday, June 27, 2014 10:47 PM GMT

Nevermind, it actually doesn't change the text either way. Why?
zub74
#138429036Friday, June 27, 2014 11:02 PM GMT

Bump
zub74
#138440961Saturday, June 28, 2014 12:57 AM GMT

Bump2
zub74
#138448322Saturday, June 28, 2014 2:07 AM GMT

b3
Vuva
#138450632Saturday, June 28, 2014 2:29 AM GMT

The whole code runs once and then never runs again. You need to connect it to an event.
Vuva
#138450756Saturday, June 28, 2014 2:30 AM GMT

Actually nvm :p My guess is that one of the if statements isn't passing even though you think it is.
AnonyAnonymous
#138453857Saturday, June 28, 2014 3:00 AM GMT

While I can't entirely figure out the problem at the moment, it seems as though the script is likely to cause conflict when it reaches five-hundred

    of     1