Guten Tag, ich bräuchte einmal Hilfe mit dem Script.
Lua
local pickup = createPickup ( 2489.83667, -1667.31445, 13.34375, 3, 1275, 50, 0 )
local allowedSkinID = {
[0] = true, [1] = true, [2] = true, [18] = true
}
function isElementWithinPickup(theElement, thePickup)
if isElement(theElement) and getElementType(thePickup) == "pickup" then
local x, y, z = getElementPosition(theElement)
local x2, y2, z2 = getElementPosition(thePickup)
if getDistanceBetweenPoints3D(x2, y2, z2, x, y, z) <= 1 then
return true
end
end
return false
end
addCommandHandler("oskin", function(player, cmd, skinID)
if isElementWithinPickup(player, pickup) then
if tonumber(skinID) > 0 and tonumber(skinID) < 302 then
if allowedSkinID[skinID] then
setElementModel(player, skinID)
outputChatBox("Du hast dich umgezogen!", player, 125, 0, 0)
else
outputChatBox("Dieser Skin ist nicht verfügbar!", player, 125, 0, 0)
end
else
outputChatBox("Die ID muss zwischen 1 und 301 liegen", player, 125, 0, 0)
end
else
outputChatBox("Du stehst nicht im richtigen Marker!", player, 125, 0, 0)
end
end)
Alles anzeigen
Ich bitte nicht drum um eine sofortige Lösung aber um Hilfe was das Problem angeht.
Sobald ich den Befehl "/oskin 2" eingebe, steht das der Skin nicht verfügbar ist. Jedoch habe ich den oben doch angegeben?
Mfg
FleX.