[Tool] Teleport Gun

Author Topic: [Tool] Teleport Gun  (Read 4277 times)


TELEPORT GUN
v.1.0

suggested by torin³ in this topic


FEATURES

This glass tube of premium black matter, powered by a big 9 volt battery and projected through an amethyst crystal, will get you and your friends where they need to go, instantly!

Click to shoot a beam of energy that will send whoever is hit into a wormhole through space time - effectively teleporting them to the included "teleSpawn" brick. Right click to shoot yourself with it



HOST INFO

This gun will teleport bots! Disable this by typing $TeleGun::TeleBots = false; into console
--------
By default, players are teleported to the shooter's teleport spawn, and if the shooter hasn't planted one, nothing will happen. If you are a minigame owner, and you want players to only teleport to your specific set spawn, type $TeleGun::MiniOnly = true; into console
--------
This tool can be abused! Make it admin only by typing $TeleGun::AdminOnly = true; into console



KNOWN BUGS:

You cannot teleport players/bots that are mounted, but if the mount is a player/bot you can teleport the mount, effectively teleporting whoever is mounted. I will have a hotfix for this in the next update



DOWNLOAD




im sorry if this sounds nitpicky but can u make a variant that has no model but still raises your arm
otherwise this is pretty cool

im sorry if this sounds nitpicky but can u make a variant that has no model but still raises your arm
otherwise this is pretty cool
all you have to do to make this is literally just delete the model or make it blank

all you have to do to make this is literally just delete the model or make it blank
Ah yes let's just force people to edit author's addons

Ah yes let's just force people to edit author's addons
he's right tho, if torin doesn't wanna use the model he can just delete the .dts in the .zip and it would be alot more time saving than relying on me to make a "no model" variant

I understand the point. Not everyone can code (I'm sure he can) but he would of done it already - I know this is a super easy task but not everyone can do it
« Last Edit: May 10, 2018, 08:04:29 AM by Kyuande »

Minor nitpick:


You don't really need a damageType for this gun, do you? You could probably just remove the addDamageType line

he's right tho, if torin doesn't wanna use the model he can just delete the .dts in the .zip and it would be alot more time saving than relying on me to make a "no model" variant

This will result in errors being echoed to the console, and you won't be able to pick up the item from bricks. As a matter of fact I don't think you'll even be able to equip the item even if you give it to players via a minigame. The correct solution here would be to change instances of "./teleGun.dts" to "base/data/shapes/empty.dts" which I'm pretty sure would fix that

forget it, just add
teleGunItem.shapeFile = "base/data/shapes/empty.dts";
teleGunImage.shapeFile = "base/data/shapes/empty.dts";

to the end of server.cs, that should work I think
« Last Edit: May 10, 2018, 08:14:52 AM by Rally »

Minor nitpick:


You don't really need a damageType for this gun, do you? You could probably just remove the addDamageType line

This will result in errors being echoed to the console, and you won't be able to pick up the item from bricks. As a matter of fact I don't think you'll even be able to equip the item even if you give it to players via a minigame. The correct solution here would be to change instances of "./teleGun.dts" to "base/data/shapes/empty.dts" which I'm pretty sure would fix that

forget it, just add
teleGunItem.shapeFile = "base/data/shapes/empty.dts";
teleGunImage.shapeFile = "base/data/shapes/empty.dts";

to the end of server.cs, that should work I think
Right you are. Was gonna say it'd be better just to copy the empty.dts from base/data/shapes and rename it as teleGun.dts and drop it in the .zip

Gah, I forgot about the CI which will never be used, and yeah the damageType should probably be removed since the gun doesn't do any damage....and I forgot to make an item icon as well. Thanks for the reminder
« Last Edit: May 10, 2018, 08:43:18 AM by Goth77 »

this actually looks really cool. will be trying this out later tonight !!

all right so I tried this out. It does work, I can teleport to the brick and all, but I get insane amounts of lag when the projectiles hits anything. :I
« Last Edit: May 10, 2018, 04:14:46 PM by Mega-Bear »

this actually looks really cool. will be trying this out later tonight !!

all right so I tried this out. It does work, I can teleport to the brick and all, but I get insane amounts of lag when the projectiles hits anything. :I
its cause the projectile oncollision code iterates through all your bricks in your brickgroup every single time it hits something, to find if you have a teleport brick.

@goth, it would be better to package onPlant/onRemove and check the brick db being added, and then set or remove a field on the brickgroup its in.

also, isObject(%col) doesnt check if the bot/player is alive, you need to do !%col.isDisabled(). just a technicality since projectiles cant hit corpses anyways.