Help with your scripting

Set player v2 as player

Set player v2 as player

Postby epsilonion » 19 Dec 2016, 17:18

When spawning in the player by LUA at the begining of a game how do you set it as the active player, I notice the command in the FPS system API but not for the simple controller.

This is using the V2 of the FPS Kit Player preset.

Code: Select all
   PlayerID = entity.spawnPreset("FPS_SpawnModel",sp1x,sp1y,sp1z);         -- Spawn the preset player v2
   --entity.setTag(playerID,"Player");                                       -- Sets the TAG of the Player


Mind you I think the preset automatically sets the TAG as Player.. so that command might not be used.

It also does not switch you to the player when you spawn in the preset this way and run in editor.
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: Set player v2 as player

Postby StarFire » 20 Dec 2016, 18:26

Yes the preset keeps the tag name.

ok spawning the fps, I will have a look as I have never tried to use it that way. Sure it wont take much to make it happen :)
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 5 guests

cron