Jump to content

Water walk


manawydan

Recommended Posts

Posted
  
local Pe = { } 
Pe.R = {} 
Pe.L = {} 
CaminharAgua = function(P,c) 
local x,y,z = getElementPosition(P) 
Pe.R[P] = createObject(2001,x,y,z) 
Pe.L[P] = createObject(2001,x,y,z) 
--setElementCollisionsEnabled 
exports [ "bone_attach" ]:attachElementToBone(Pe.R[P],P,20,0,0,-1) 
exports [ "bone_attach" ]:attachElementToBone(Pe.L[P],P,19,0,0,-1) 
outputChatBox("lol",P) 
end 
addCommandHandler("agua",CaminharAgua) 

i try, but no work, with -1 and 0

any help?

Posted

As far as I know you can't walk on attached elements because once attached their collision data is lost. Besides, attached elements to the player will follow the player, so if player's in the water, the element is under water with them.

Posted

Create the object in client side. get the position X, Y (No Z) of local player and set the position X, Y to the object and keep z position of the object at static number 0 or -1 or something like that and use the event onClientRender to keep the object attached under the player.

Posted
You can create an invisible object and then walk over it..

Did you even bother to read the replies? If you had, you would have seen that KRZO said this.

i did, he said underwater, i said invisible, you seriously need to get some glasses on.

Posted

thank you, the player slides a little, but it works.

-- water walk 
local obj = {} 
  
function WaterWalk() 
if obj[localPlayer] then 
local x,y,_ = getElementPosition(localPlayer) 
setElementPosition(obj[localPlayer],x,y,-.5) 
end 
end 
addEventHandler ("onClientRender",root,WaterWalk) 
  
function WaterOn() 
local px,py,_ = getElementPosition(localPlayer) 
obj[localPlayer] = createObject(1221,px,py,0) 
setElementAlpha(obj[localPlayer],0) 
end 
addCommandHandler("water",WaterOn) 

mta-screen_2014-01-05_14-36-19.jpg

Posted
thank you, the player slides a little, but it works.
-- water walk 
local obj = {} 
  
function WaterWalk() 
if obj[localPlayer] then 
local x,y,_ = getElementPosition(localPlayer) 
setElementPosition(obj[localPlayer],x,y,-.5) 
end 
end 
addEventHandler ("onClientRender",root,WaterWalk) 
  
function WaterOn() 
local px,py,_ = getElementPosition(localPlayer) 
obj[localPlayer] = createObject(1221,px,py,0) 
setElementAlpha(obj[localPlayer],0) 
end 
addCommandHandler("water",WaterOn) 

mta-screen_2014-01-05_14-36-19.jpg

This works because itachi is using genjutsu. :roll:

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