Jump to content

Script doesn't work in map editor but does on server?


hulpje

Recommended Posts

Hi, i'm creating a race map and just want to create a little trolling script where people teleport somewhere else when they write "delete map" in the chat.

The problem: I usually work in the map editor / local server and if I write "delete map" I get a debugmessage ("what the :O").
If I write "delete map" in a hosted server of a friend it does work and teleport me.

My questions: why the script works different and can I make it work in the map editor somehow?
 

function memestars(text, element)
  if string.match(text, "delete map") then
    if isElement(element) and getElementType(element) == 'player' then
        bigbitch = getPedOccupiedVehicle(element)
        setElementPosition(bigbitch, 5202, 256, 87)
    else
        iprint("wat the :O: ", text, element)
    end
  end
end
 
addEventHandler("onChatMessage", root, memestars)

 

Link to comment

Are you sure you're using totaly same script on both servers and writing it normally in chat as player? This should work just fine on both local and hosted servers. Maybe try to output element type in debugscript and reply what it is, if it's "not" a player.

  • Like 1
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...