I'm a newbie to lua right now and I looked at the error and I never knew what that error meant but I do know what other errors mean.
local dialog = script.Parent 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 KOs = stats:FindFirstChild('KOs') if not KOs then return end if choice == dialog.DialogChoice['YES'] then if KOs.Value >= 1500 then game.ReplicatedStorage.Weapon6:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 1500
Now here's the output
Workspace.Dilinz Fifto.Head.Dialog.Script:15: 'end' expected (to close 'if' at line 12) near '<eof>'
You always have to have an end
when working with functions, if statements, most loops, etc. You have it on line 2.
The end
tells the script where the if statement, well, ends. It's where the code will stop being effected by the outcome of the condition and just run normally. It's pretty straightforward.
if choice == dialog.DialogChoice['YES'] then if KOs.Value >= 1500 then game.ReplicatedStorage.Weapon6:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 1500 end end