For some reason this script attaches the player but it warps them around and weirds up the positions on other peoples clients... what am I doing wrong?
PHP Code:
if(playertouchsme&&!playerattached){
playerx=x+7.5;
playery=y+9;
attachplayertoobj 0,id;
timeout=0.05;
}
//#CLIENTSIDE
function onCreated(){
drawunderplayer();
setshape2(18, 38, {
00,00,00,22,22,22,22,22,22,22,22,22,22,22,22,00,00,00,
00,00,00,22,22,00,00,00,00,00,00,00,00,22,22,00,00,00,
00,00,00,22,22,00,00,00,00,00,00,00,00,22,22,00,00,00,
00,00,22,22,22,00,00,00,00,00,00,00,00,22,22,22,00,00,
00,22,22,22,22,00,00,22,22,22,22,00,00,22,22,22,22,00,
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
22,22,00,00,00,00,00,22,00,00,22,00,00,00,00,00,22,22,
22,22,22,00,00,00,00,22,00,00,22,00,00,00,00,22,22,22,
22,22,22,22,00,00,00,22,00,00,22,00,00,00,22,22,22,22,
22,22,22,22,22,00,00,00,00,00,00,00,00,22,22,22,22,22,
00,22,22,22,22,22,00,00,00,00,00,00,22,22,22,22,22,00,
00,00,22,22,22,22,22,00,00,00,00,22,00,22,22,22,00,00,
00,00,00,22,22,22,22,22,00,00,22,00,00,22,22,00,00,00,
00,00,00,00,22,22,22,22,22,22,22,22,22,22,00,00,00,00,
00,00,00,00,00,22,22,22,22,22,22,22,22,00,00,00,00,00,
00,00,00,00,00,00,22,22,22,22,22,22,00,00,00,00,00,00,
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,22,22,00,00,00,00,00,00,00,00,
});
}
function onTimeout(){
if (keydown(6)){
detachplayer;
player.x=x-4;
player.y=y-4;
setplayerprop #c,You left the boat.;
}
setTimer(0.05);
}