Hello,
I'm making a script, once they have been clicked, they have been selected. But the problem is... This script is acting weird. And saying it is missing a end for the function. But I ended it.
This error I got
'end' expected (to close 'function' at line 7) near 'elseif'
Here is the script.
local mouse = game.Players.LocalPlayer:GetMouse()
target1 = nothing
target2 = nothing
target3 = nothing
target4 = nothing
target5 = nothing
mouse.Button1Down:connect(function()
local part = mouse.Target
if part.Parent:FindFirstChild("Humanoid") ~= nil then
print("Humanoid!")
local humanoid = part.Parent:FindFirstChild("Humanoid")
if script.Bools.Target1.Value == false then
target1 = part.Parent.Name
script.Bools.Target1.Value = true
script.Bools.Target1.TargetName.Value = (part.Parent.Name)
end
elseif
script.Bools.Target2.Value == false then
if part.Parent.Name == target1 then end
else
target2 = part.Parent.Name
script.Bools.Target2.Value = true
script.Bools.Target2.TargetName.Value = (part.Parent.Name)
end
elseif
script.Bools.Target3.Value == false then
if part.Parent.Name == target1 or target2 then end
else
target3 = part.Parent.Name
script.Bools.Target3.Value = true
script.Bools.Target3.TargetName.Value = (part.Parent.Name)
end
elseif
script.Bools.Target4.Value == false then
if part.Parent.Name == target1 or target2 or target3 then end
else
script.Bools.Target4.Value = true
script.Bools.Target4.TargetName.Value = (part.Parent.Name)
end
elseif
script.Bools.Target5.Value == false then
if part.Parent.Name == target1 or target2 or target3 or target4 then end
else
target5 = part.Parent.Name
script.Bools.Target5.Value = true
script.Bools.Target5.TargetName.Value = (part.Parent.Name)
end
else
print("What is this?")
end
end)
could you help me?
