-- Simple script to spawn a heart made of arrows when clicking
-- Formula for the heart curve:
http://mathworld.wolfram.com/HeartCurve.htmlfunction main()
for playerName in pairs(tfm.get.room.playerList) do
eventNewPlayer(playerName)
end
end
function eventNewPlayer(playerName)
system.bindMouse (playerName, true);
end
function eventMouse (playerName, mx, my)
local size = 5;
local x_position = mx;
local y_position = my;
for t=0,2*math.pi,0.1 do
x=(16*math.sin(t)^3)*size + x_position
y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
y=-y + y_position
tfm.exec.addShamanObject(0,x,y);
end
end
main ();
Boa sorte