Forum

> > CS2D > Scripts > smoke not at player(near)
Forums overviewCS2D overview Scripts overviewLog in to reply

English smoke not at player(near)

4 replies
To the start Previous 1 Next To the start

old smoke not at player(near)

Mora
User Off Offline

Quote
Hello us
I need help, make colorsmoke,smoke,fire,etc near player,ex
parse('effect "smoke" '..player(id, "x")..' '..player(id, "y")..' 10 10')>this smoke at player,but i need near,ex
('effect "fire" '..player(id, "x"+20) <some like this,(i know that is not correct.
Thanks

old Re: smoke not at player(near)

Avo
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
AnglePosition = function(rot, x, y, factor)
    if rot < -90 then rot = rot + 360 end
    local angle = math.rad(math.abs(rot + 90)) - math.pi
    local x = x + (math.cos(angle) * factor)
    local y = y + (math.sin(angle) * factor)
    return x, y
end
-- paste code below in the proper place in your script:
local x, y = AnglePosition(player(id, "rot"), player(id, "x"), player(id, "y"), -20)
parse('effect "smoke" '..x..' '..y..' 10 10')
This spawns smoke behind player.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview