Jump to content

no warp


Recommended Posts

Hi, im trying to make a script that when someone is in a colzone they can only be warped to by people in the staff acl group. This is where im at now, because im stuck. I dont know how to continue the warping when they are in the acl group.

col  = createColTube (-1752, -2978, 55, 100, 17) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. 
root = getRootElement () 
  
function warp ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Staff" ) ) then 
        end 
    end 
end   
addEventHandler ( "onSetPos", col, warp) 

EDIT: Will this work instead?

col  = createColTube (-1752, -2978, 55, 100, 17) 
root = getRootElement () 
  
function warp ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Staff" ) ) then 
    else 
    outputChatBox("You cannot warp to this person currently", getRootElement(), 0, 255, 0) 
        end 
    end 
end   
addEventHandler ( "onSetPos", col, warp) 

Link to comment
col  = createColTube (-1752, -2978, 55, 100, 17) 
  
function warpThePlayer(hitElement, matchingDimension) 
    if (getElementType(hitElement) == "player") and (matchingDimension) then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Staff" ) ) then 
            setElementPosition() --Type here your coordinates 
        end 
    end 
end 
addEventHandler("onColShapeHit", col, warpThePlayer) 

You need use the event onColShapeHit (is called when a element hit the ColShape). And remember, if you use outputChatBox() using getRootElement() in the second argument, the message will be displayed to all players in the server. You must use:

outputChatBox("You cannot warp to this person currently", hitElement, 0, 255, 0) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...