You need an end to finish the 'if' statements, and you also need to pay attention to your capitalization. Remember Lua is case-sensitive.
###Problem 1:
All 'if' statements need end's to finish them correctly. To fix it in your script, we'll simply add them in where they belong, which is at the end of the statement:
local stats = player:FindFirstChild("leaderstats")
if not stats then return end
local money = stats:FindFirstChild("Money")
if not money then return end
######(You also forgot one on line 13)
###Problem 2:
You just made a simple mistake here on line 10. You need to remember to use the correct case for things like this. The 'Then' should be 'then'. Remember to pay attention to this from now on.
##Final Product
Ok, so here's the finished script:
local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local stats = player:FindFirstChild("leaderstats")
if not stats then return end
local money = stats:FindFirstChild("Money")
if not money then return end
if choice == script.Parent.DialogChoice.ChoiceA then
if money.Value >= 0 then
game.ReplicatedStorage.Fishingtool:clone().Parent = player.Backpack
end
end
end)
Ok, so now this should work for you :P
Anyways, if you have any further problem/questions, please leave a comment below. Hope I helped :P
####-Dyler3
5 comments
ty but now this is a error if money amount >= 0 then the amount part
Nvm i just removed it and it worked, Dyler do you have a Steam account you can add me on?
Yea, but why Steam?
Idk can you add me ? Name is FreezeShot
Dyler you going to add me?