here is the script im working on
modelname="players"
function onTouched(hit)
if not hit or not hit.Parent then return end
local human = hit.Parent:findFirstChild("Humanoid")
if human and human:IsA("Humanoid")and if game.Players:playerFromCharacter(hit.Parent).TeamColor==game.Teams:findFirstChild(modelname).TeamColor then
human:TakeDamage(100)
else
end
end
script.Parent.Touched:connect(onTouched)
i just need someone to explain what it wants when it says there error message
In the if statement, there are two
ifkeywords. This is most likely the source of the error. To fix it, remove the secondif.Fixed function
If nothing is happening in the else statement, it can be safely removed. Add it back if you have to though.
The error is basically lua expecting more than what was given, in this case a block of code defined in a then-end block.