Jump to content

setting a default skin for spawn/connecting


5150

Recommended Posts

Posted

so i have private skins in my server, but every time a player spawns, they get a random skin, which sometimes allows them access to the private skins (if they get it by luck with default). does anyone have a script that will always set a players skin to 0 (CJ) when they spawn?

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

thanks

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

tried it, didnt work

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted
  
function setSkinOnSpawn () 
    setPedSkin ( source, 0 ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), setSkinOnSpawn ) 
  

Posted
function skin () 
setPedSkin ( source, 0 ) 
end 
addEventHandler("onPlayerSpawn", getRootElement(), skin) -- spawn 
addEventHandler("onPlayerJoin", getRootElement(), skin) -- join 

Posted

still not working.... maybe its me? i added a meta, everythings named correctly, and its in a zip file. i start it and it successfully loads/starts but it still doesnt set the skin to CJ when i spawn

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

  • Make sure that the script is in the right type (server)
  • Make sure that there's no other resources which sets the player's skin (spawnmanager etc)

Also don't use 1LoL1/ozulus' code, setPedSkin is a deprecated function.

Posted

can i just add the script to the spawnmanager? because i kinda need spawnmanager :P

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

and then what do i use if i cant use setpedskin?

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted
setElementModel 

If a skin is still being given randomly and the code is not working, I take it you are using the freeroam resource? My guess is that would be overriding your code.

Posted

ok thanks, but like i asked is there a way to add this into spawnmanager? i need my spawnpoints working + setskin to default when a player joins or spawns

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

Yes, when you create your spawnpoints using createSpawnpoint (spawnmanager/spawn.lua - line 6), just specify the skin as the ID of your default skin to 0.

exports.spawnmanager:createSpawnpoint(0, 0, 5, 90, 0 --[[ CJ skin ]], 0, 0) 

That will create a spawnpoint at 0, 0, 5 (center of the map), rotate the player 90 degrees, spawn him with the CJ skin and put him in interior and dimension 0.

Posted

oh cool, thanks man

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

oh wtf i used the play gamemode to create the spawnpoints..... sorry im making this so complicated lol. this is basically how i did it

BrophY

1.0

at the very bottom

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

the play gamemode doesn't uses createSpawnpoint, it just spawn the player using spawnPlayerAtSpawnpoint and then set him skin to a random one.

To edit this just open play/broph.lua and find line 19:

repeat until setElementModel(player,math.random(312)) 

change to:

setElementModel( player, 0 ) 

Posted

thanks! worked

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...