• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

zone locked and zone unlock for playername

Status
Not open for further replies.

Xaver

Respected Member
hello im well zone locked for all player but well seperate name past into script and this playername is not locket for zune zb:




local NPC_ID = 7


local function AreaTrigger_MoveInLOS(event, creature, player)
player:Teleport(560, 2029.25, 1992.37, 118.044, 1.61652)
--RestrictedMessage = "Dieser bereich ist Gesperrt !!"
player:SendBroadcastMessage("|cffFF0000Dieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe|r")
player:SendBroadcastMessage("|cffFFFFFFDieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe")
player:SendBroadcastMessage("|cffFF0000Dieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe")

end


RegisterCreatureEvent(NPC_ID, 23, AreaTrigger_OnSpawn)
RegisterCreatureEvent(NPC_ID, 27, AreaTrigger_MoveInLOS)




this script locked zone for all player




im well this :

if(player:GetName() == "Xaver" or player:GetName() == "Sutaran" or player:GetName() == "Reaper" or player:GetName()

this player have no lock zone all anoter player lock for zone



I understand what my
 

Rochet2

Moderator / Eluna Dev
AreaTrigger_OnSpawn is undefined, nil.
So the script will error upon loading before RegisterCreatureEvent(NPC_ID, 27, AreaTrigger_MoveInLOS) is ran.
This means that the script will never actually teleport anyone.

Also, you falsely assume that the arguments are AreaTrigger_MoveInLOS(event, creature, player)
The actual arguments are event, creature, unit.
This means that the last argument can be creature or player. Creature can not be teleporter nor a broadcast message can be sent to it.
This means that you will have nil errors about nonexistant methods whenever a creature passes by
https://github.com/ElunaLuaEngine/Eluna/blob/master/HookMgr.h#L223

Assuming you posted the entire script.

Post the whole script that does not work.
It is hard to get what you mean and what the whole picture is when you offer incomplete IF statements and snippets as well as code that is not complete or nothing to do with the issue at hand.
 
Last edited:

Xaver

Respected Member
So I want a vip zone have where only certain players can even

the other player if the name of the player is not in the script should be ported away
 

Kaev

Super Moderator
Next time post something in german and write me a PM and i'll translate it for every1, it's very hard to understand you. Or use Google translator.

He wants a script that will do the following (Pseudo C++-code!):

Code:
if player.zoneChanged() then
    if(!player.Name = "Xaver" || !player.Name = "Kaev" [..]) // [..] = more names
       player.portTo(x, y, z); // own coordinates

I haven't done anything with Eluna yet, so i can't help you with this atm.
 

Rochet2

Moderator / Eluna Dev
Did not test this, but here:
Code:
local NPC_ID = 7

local function AreaTrigger_MoveInLOS(event, creature, player)
    local name = player:GetName()
    if (name == "Xaver" or name == "Sutaran" or name == "Reaper") then
        return
    end
    player:Teleport(560, 2029.25, 1992.37, 118.044, 1.61652)
    -- RestrictedMessage = "Dieser bereich ist Gesperrt !!"
    player:SendBroadcastMessage("|cffFF0000Dieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe|r")
    player:SendBroadcastMessage("|cffFFFFFFDieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe")
    player:SendBroadcastMessage("|cffFF0000Dieser bereich ist Gesperrt !! für Player Bitte GM einschalten oder warten bis zur Freigabe")
end

RegisterCreatureEvent(NPC_ID, 27, AreaTrigger_MoveInLOS)
 
Status
Not open for further replies.
Top