While I was writing my code I stumbled across an error. I tried deleting it but didn’t work. Any help will be appreciated.
for i,Part in pairs(game.Workspace.Maps:GetChildren()) do
if(Part:IsA(“Part”)) then
Part.Touched:Connect(function(hit)
if (game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)) then
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if(Part.Name == "TeleportMagic1") then
if(player.MapVtojh.Value == "Map1") then
elseif (player.MapVtojh.Value == "Map2") then
player.MapVtojh.Value = "Map1"
workspace.MapUpVote.Map2.Value - 1
workspace.MapUpVote.Map1.Value + 1
elseif (player.MapVtojh.Value == "Map3") then
player.MapVtojh.Value = "Map1"
workspace.MapUpVote.Map3.Value - 1
workspace.MapUpVote.Map1.Value + 1
elseif (player.MapVtojh.Value == "") then
player.MapVtojh.Value = "Map1"
workspace.MapUpVote.Map1.Value + 1
end
elseif(Part.Name == "TeleportMagic2") then
if(player.MapVtojh.Value == "Map2") then
elseif (player.MapVtojh.Value == "Map1") then
player.MapVtojh.Value = "Map2"
workspace.MapUpVote.Map2.Value + 1
workspace.MapUpVote.Map1.Value - 1
elseif (player.MapVtojh.Value == "Map3") then
player.MapVtojh.Value = "Map2"
workspace.MapUpVote.Map3.Value - 1
workspace.MapUpVote.Map2.Value + 1
elseif (player.MapVtojh.Value == "") then
player.MapVtojh.Value = "Map2"
workspace.MapUpVote.Map2.Value + 1
end
elseif(Part.Name == "TeleportMagic3") then
if(player.MapVtojh.Value == "Map3") then
elseif (player.MapVtojh.Value == "Map1") then
player.MapVtojh.Value = "Map3"
workspace.MapUpVote.Map3.Value + 1
workspace.MapUpVote.Map1.Value - 1
elseif (player.MapVtojh.Value == "Map2") then
player.MapVtojh.Value = "Map3"
workspace.MapUpVote.Map2.Value - 1
workspace.MapUpVote.Map3.Value + 1
elseif (player.MapVtojh.Value == "") then
player.MapVtojh.Value = "Map3"
workspace.MapUpVote.Map3.Value + 1
end
end
end
end)
end
end
end) --- Error
end)
end
end