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

[SOLVED] Unlock door's for guild member's

Status
Not open for further replies.

mjafko

Epic Member
Hello.

Well Is there anyway ( Well I know everything is possible, but... ) to make a door to a building which allow entrence only to member of xy guild ?
And if there is how for a bit of explanation would be helpfull.

Thank you Emudev's member's you're best!

Greeting's,
Marko.
 

FoxGaming

Exalted Member
Using
Code:
GAMEOBJECT_EVENT_ON_USE                         = 14,   // (event, go, player)
you could write a function that checks if the player using the door is in a certain guild.

I wrote a sample script, don't know if it works so no promises there.
Code:
local gameobject_entry = 12345 --ID of the Door
local guild_id = 1 --ID of the guild that is allowed through the door.

--[[
-- Checks the Player's Guild, if the player is in the specified guild
-- the door is "opened". Else, the door will be set to closed.
-- ** Not Tested **
--]]
function handleLockedGuildDoor(event, go, player) 
    if(player:GetGuildId() == guild_id) then
        go:SetGoState(0) 
    else
        go:SetGoState(1)
        player:SendBroadcastMessage("You do not have access to this door.")
    end
end

RegisterGameObjectEvent(gameobject_entry, 14, handleLockedGuildDoor)
 
Status
Not open for further replies.
Top