• Throwable disk weapon that returns?
    2 replies, posted
So, I'm creating a large Tron pack with a friend of mine, and we have the identity disks from the movie, we'd like to turn them into a basic swep that can be thrown, and comes back to the player. Would this be hard to code? Can anyone give any tips on how to start something like this?
It wouldn't be hard, althought it would require some math and thinking. If you want it to go back to you, no matter what obscale it meets, you would have to make it not collide with world. What I would do is: -Make a basic swep that just spawns the disc -Script the entity so it has 2 modes: fly to target, return to shooter The second mode would basically be the first mode with the difference that shooter would be the target instead.
[lua] local speed = 256 -- Movement speed. entity:SetVelocity(player:GetAimVector() * speed) -- Throws to target. entity:SetVelocity((player:GetPos() - entity:GetPos()) * speed) -- Fly back to owner. [/lua] Should give you a rough idea of how it would be done.
Sorry, you need to Log In to post a reply to this thread.