Page 1 of 1

How to make player teleporter and weapon spawner

Posted: Tue Aug 08, 2017 3:20 am
by RamboCreativity
How do I make an area trigger that when yo enter you teleport somewhere else.
Also can I make a spawnweapontrigger spawn weapons that are dynamic, it only spawns static weapons and I'm trying to have a knife fall from a vent.
Any help would be great.

Re: Few questions

Posted: Tue Aug 08, 2017 4:20 am
by Hoang Marcel
Paste this script into your map :

public void Teleport(TriggerArgs arg){
IPlayer ply = (IPlayer)arg.Sender;
IObject obj = Game.GetSingleObjectByCustomID("obj");
Vector2 pos = obj.GetWorldPosition();
ply.SetWorldPosition(pos);
}

And then create an AreaTriggger with script method Teleport and create a non solid static title like an InvisibleBlockNoCollision with ObjectID obj

Instead of using the WeaponSpawnTrigger, use the SpawnObjectTrigger.