English Turrets aren't built at the exact tile

2 replies
Goto Page
To the start Previous 1 Next To the start
Up
Spy-eR
User
Offline Off
Hello everyone,

I want just some help,
I'm not Scripter so i don't know about that but this script i had got by asking Unreal software, but it has some problem.

Code:
addhook("projectile", "_p")
function _p(id, wpn, x, y)
if (wpn == 54) then
local team = player(id, "team")
parse("spawnobject 11 "..((x-16)/32).." "..((y-16)/32).." 0 0 "..team.." "..id)
end
end


I have Check it & its Working, But When i Throw it So Turret Build on the Other side, Whereas at a exact tile Separate, where flare dropped.Why turret didn't build on exact tile where flare dropped.
Please Correct him for me.I want just where it will be drop so turret always make there place.
FRiendly boYy.

Admin/mod comment:

Don't choose generic titles for your topic please. Changed. /user Fraizeraust
16.04.18 05:48:48 pm
Up
Cure Pikachu
User
Offline Off
Because your pixel-to-tile conversion formula is incorrect?
Try
parse("spawnobject 11 "..math.floor(x/32).." "..math.floor(y/32).." 0 0 "..team.." "..id)
IMG:https://i.imgur.com/5UWPaft.png
IMG:https://i.imgur.com/xpsyQRX.png
16.04.18 06:03:41 pm
Up
Spy-eR
User
Offline Off
yeah Thanks it working.
FRiendly boYy.
To the start Previous 1 Next To the start