Ok, agora no debugscript ele me retorna "=" expected near ' na linha 9
Eu resolvi o erro mas quando eu coloco /setmask e o id
o script retorna novamente o erro de sintaxie no chatbox
local mascaras = {
"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}
mascaras = {}
yelekTable = {}
mascaras["devil"] = {1512, 1, 90}
mascaras["vendetta"] = {1455, 1, 90}
mascaras["darth"] = {1484, 1, 90}
mascaras["horse"] = {1485, 1, 90}
mascaras["gasmask"] = {1487, 1, 90}
mascaras["kovboy"] = {1543, 1, 90}
mascaras["zombie"] = {1544, 1, 90}
mascaras["vampire"] = {1666, 1, 90}
mascaras["skull"] = {1667, 1, 90}
mascaras["raccoon"] = {1668, 1, 180}
mascaras["owl"] = {1950, 1, 180}
mascaras["cat"] = {1951, 1, 180}
mascaras["bag"] = {1551, 1, 90}
mascaras["dog"] = {1546, 1, 90}
mascaras["baby"] = {1669, 1, 90}
mascaras["monster"] = {1853, 1, 90}
mascaras["tilki"] = {1854, 1, 90}
mascaras["admin"] = {1855, 1, 180}
obje = {}
yelek = {}
addCommandHandler( "setmask",
function ( player, cmd, id)
local name
if id and mascaras[tonumber(id)] then
id = tonumber(id)
name = mascaras[id]
else
return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
end
if id == #mascaras then
if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
if obje[player] then
destroyElement(obje[player])
end
local objeid = mascaras[name][1]
local bodyattach = mascaras[name][2]
local zROT = mascaras[name][3]
obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
else
outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
end
elseif id == 4 then
if obje[player] then
destroyElement(obje[player])
end
local objeid = mascaras[name][1]
local bodyattach = mascaras[name][2]
local zROT = mascaras[name][3]
obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
else
if obje[player] then
destroyElement(obje[player])
end
local objeid = mascaras[name][1]
local bodyattach = mascaras[name][2]
local zROT = mascaras[name][3]
obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
end
end, false, false
)
function quitPlayer ( )
if obje[source] then
destroyElement(obje[source])
obje[source] = nil
end
if yelek[source] then
destroyElement(yelek[source])
yelek[source] = nil
end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )
ok eu reprogramei todo o codigo e funcionou agradeço a Ajuda