Cunning fox Posted February 12, 2017 Share Posted February 12, 2017 (edited) Hey everyone! I'm trying to add new prefab. When you eat it, you'll be teleported to pig king, for example. But I realy dont know how to make it. Any ideas? I appreciate all of your replies! Thanks for trying to help! Edited February 12, 2017 by makar5000 1 Link to comment Share on other sites More sharing options...
Lumina Posted February 12, 2017 Share Posted February 12, 2017 Maybe you can see how the teleportation of the staff works, since it teleport you in a telelocator focus if one is activated. Link to comment Share on other sites More sharing options...
. . . Posted February 12, 2017 Share Posted February 12, 2017 (edited) Well there's a console command " c_gonext("pigking") " maybe you can make it run that command oneat function somehow...maybe! Edited February 12, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
Cunning fox Posted February 13, 2017 Author Share Posted February 13, 2017 7 hours ago, SuperDavid said: Well there's a console command " c_gonext("pigking") " maybe you can make it run that command oneat function somehow...maybe! Nope, not working. I've added this: local dest = ("pigking") if dest ~= nil then if eater ~= nil then if eater.Physics ~= nil then eater.Physics:Teleport(dest.Transform:GetWorldPosition()) else eater.Transform:SetPosition(dest.Transform:GetWorldPosition()) end SuUsed("c_goto", true) return dest end end And it crashed with [00:00:47]: [string "../mods/foxy's mod 0.2/scripts/prefabs/hum_..."]:254: attempt to index field 'Transform' (a nil value) 1 Link to comment Share on other sites More sharing options...
HabdomeRaider Posted February 13, 2017 Share Posted February 13, 2017 local dest = c_find("pigking") Link to comment Share on other sites More sharing options...
Leonardo Cox Posted February 14, 2017 Share Posted February 14, 2017 (edited) -nvm Im dumb- Edited February 14, 2017 by DarkKingBoo Link to comment Share on other sites More sharing options...
RedHairedHero Posted February 17, 2017 Share Posted February 17, 2017 (edited) On 2/13/2017 at 2:04 AM, HabdomeRaider said: local dest = c_find("pigking") Only problem I can see with using a console command is if the character being played is not the host. This is just off the top of my head though, I haven't tested this theory. Edit: You should just be able to use FindEntity to get the Pig King's coordinates. Edited February 17, 2017 by RedHairedHero Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now