Jump to content

Script HElp.


Recommended Posts

I've made this simple script to set the player position...but when i try to do /setpos 125 156..like use x, y..i get error in debugscript 3 ...and i don't want this error move to debugscript 3 because it's mistake to write x and y..or even z only..so how to fix this?

function pSet (source, commandName, arg, posX, posY, posZ) 
        if arg then 
            setElementPosition (source, posX, posY, posZ) 
        else 
            outputChatBox ("Use: /setpos x,y,z", source, 255, 0, 0, false) 
    end 
end 
addCommandHandler ( "setpos", pSet  ) 

Link to comment
function pSet(source, commandName, posX, posY, posZ) 
    local posX, posY, posZ = tonumber(posX), tonumber(posY), tonumber(posZ) 
    if posX and posY and posZ then 
        setElementPosition(source, posX, posY, posZ) 
    else 
        outputChatBox("Use: /setpos x,y,z", source, 255, 0, 0) 
    end 
end 
addCommandHandler("setpos", pSet) 

Link to comment
function pSet(source, commandName, posX, posY, posZ) 
    local posX, posY, posZ = tonumber(posX), tonumber(posY), tonumber(posZ) 
    if posX and posY and posZ then 
        setElementPosition(source, posX, posY, posZ) 
    else 
        outputChatBox("Use: /setpos x,y,z", source, 255, 0, 0) 
    end 
end 
addCommandHandler("setpos", pSet) 

Thanks :)

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