2DWorlds Forums
How would we make teleporters? - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: How would we make teleporters? (/showthread.php?tid=1992)

Pages: 1 2


How would we make teleporters? - broloxer - 04-03-2011

Is there a script to it?


RE: How would we make teleporters? - Scripter - 04-03-2011

I've done it already.

[lua]
link(script.Parent.Collided, function(hit)
if hit.Name == "Body" then
hit.Position = Vec2D(#,#)
end
end)
[/lua]

I didn't test that script so there may be one or two errors in it, but I made a script just about like that which worked.


RE: How would we make teleporters? - broloxer - 04-04-2011

(04-03-2011, 11:46 PM)Scripter Wrote: I've done it already.

[lua]
link(script.Parent.Collided, function(hit)
if hit.Name == "Body" then
Body.Position = Vec2D(#,#)
end
end)
[/lua]

I didn't test that script so there may be one or two errors in it, but I made a script just about like that which worked.

How would you make it change the place it went to?


RE: How would we make teleporters? - Scripter - 04-04-2011

Changing the # signs. They are the positions.


RE: How would we make teleporters? - broloxer - 04-04-2011

Thanks! Big Grin


RE: How would we make teleporters? - broloxer - 04-04-2011

Thanks! Big Grin


RE: How would we make teleporters? - Scripter - 04-04-2011

(04-04-2011, 12:18 AM)broloxer Wrote: Thanks! Big Grin

No problems. Giving a thanks would be appreciated ;p


RE: How would we make teleporters? - Blizzard - 04-04-2011

Somebody should make a cooler one that makes you fade out and in.


RE: How would we make teleporters? - Scripter - 04-05-2011

(04-04-2011, 10:36 PM)Blizzard Wrote: Somebody should make a cooler one that makes you fade out and in.

That should be easy enough, made this script just now without testing:

[lua]
link(script.Parent.Collided, function(hit)
if hit.Name == "Body" then
for i = 10, 1, -1 do
hit.Transparency = i
end
hit.Position = Vec2D(#,#)
for i = 1, 10 do
hit.Transparency = i
end
end
end)[/lua]


RE: How would we make teleporters? - Scripter - 04-11-2011

Yeah, I was careless and mistyped something. I fixed it though, it should work now.