Jump to content

[help] how do I disable spawning if player dimension isn't 0


RLZ

Recommended Posts

Posted

Hello, I'm new to scripting and I want to disable spawning in play/broph.lua if player dimension is not 0.

I tried

addEventHandler("onPlayerWasted", root, 
if getElementDimension ( source ) == 0 then 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
end  
) 

And it didn't work. What am I doing wrong? Thanks.

Posted

Put the if statement inside the function instead

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted
addEventHandler("onPlayerWasted", root, 
function () 
    if getElementDimension ( source ) == 0 then 
        setTimer(spawn, 1800, 1, source) 
    end 
end  
) 

Not gunna work if you post the if statement inside the event handler rather than the function but try that.

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...