I have made a script and came across this error;
Players.Player1.PlayerGui.BattleGui.BattleFrame.AttackButton.LocalScript:10: 'then' expected near ','
I can't read errors and I don't know how to fix em, please help!
This is the script;
local button = script.Parent
local SH = script.Parent.Parent.NPCCardFrame.Health:WaitForChild("HealthAmount")
local PA = script.Parent.Parent.PlayerCardFrame.Attack:WaitForChild("AttackAmount")
local accuracy = script.Parent.Parent.PlayerCardFrame.Accuracy:WaitForChild("AccuracyAmount")
button.MouseButtonDown:connect(function()
wait(0.5)
local MissChance = math.random(1,100)
if MissChance == 1 , accuracy.Value then
SH.Value = PA.Value - SH.Value
else
print("Attack Missed!")
end
end)
Please help me fix errors or explain to me what I need to do to fix it.
Error: 12:27:41.067 - Players.Player1.PlayerGui.BattleGui.BattleFrame.AttackButton.LocalScript:10: 'then' expected near ',' Realism Mod is running on v1.795!
It says the error is on this line;
if MissChance == 1 , accuracy.Value then

2 comments
What is the comma supposed to represent to you? If you are using it to represent a range of numbers, then I recommend that you use "MissChance >= 1 or MissChange >=accuracy.Value" instead.
This article will help with reading errors: http://wiki.roblox.com/index.php?title=Lua_errors, and this one might interest you if you are making lists: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=65119973