kieran Posted June 20, 2017 Share Posted June 20, 2017 Hello, I have just made an interior but I was wondering if you could set 2 markers within the same interior, basically I want to warp my guy from one bit of my interior to another on a marker hit. This is what I got so far: one_marker = createMarker(126.9833984375, 407.57830810547, 893.24072265625, "arrow", 0.8, 255, 255, 0, 170 ) two_marker = createMarker(127.30000305176, 386, 859.20001220703, "arrow", 0.8, 255, 255, 0, 170 ) setElementInterior(one_marker, 2, 126.9833984375, 407.57830810547, 893.24072265625) setElementInterior(two_marker, 2, 127.30000305176, 386, 859.20001220703) function int_test(player) if (source == one_marker and getElementType(player) == "player") then setElementInterior(player, 2, 127.30000305176, 388, 859.20001220703) setElementFrozen(player,false) setTimer(setElementFrozen, 1000, 1, player, false) elseif (source == two_marker and getElementType(player) == "player") then setElementInterior(player, 2, 126.30000305176, 407.60000610352, 892.40002441406) setElementFrozen(player,false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", root, int_test) The markers are there but do nothing when I hit them, I sort of figured out it's because you can't send yourself to the same interior, but I thought I'd post just to see if there is a way. Link to comment
!#NssoR_) Posted June 20, 2017 Share Posted June 20, 2017 You should use setElementPosition function instead setElementInterior. Because if you already in interior number 2 the function won't work ( returns false ). So use setElementPosition. 2 Link to comment
kieran Posted June 20, 2017 Author Share Posted June 20, 2017 Thanks I completely forgot that was a thing haha, only needed to use it once. it works perfect now :3 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now