Jump to content

Can u change skins at spawnpoint


heavy air

Recommended Posts

HELLO

i am trying to define what skins are randomly chosen when u spawn a player

i only like about 20 - 25 of the skins and would like to use just them

i use broph/fr gamemode and i have found the spawnpoint but i can only set it to choose between a single range of numbers

EG : 10 - 20 / 21 - 30 and so on

what i want to do is set 16, 33, 61, 164, 165, and so on

im not sure how to put this into the line

i can use the randInt command but it only seems to accept two numbers to create skins

i really want to be able to set individual numbers into the field so it will only spawn with the skins i set but still at random

Link to comment

sweet

thank u very much will give it a go :D

EDIT : seem to be having trouble with the syntax

should i put this within the spawn function or run it as a separate function :oops:

it seems to be a problem with this

local spawn_skins = { 16, 33, 61, 164, 165 }

EDIT 2 : sorry i just noticed i had some of the characters wrong but have got them right now

no longer gives an error but just uses default cj skin now

this is from the broph script and i think ive got it setup right but i guess not

function spawnThePlayer ( player )

local b = spawnPlayer ( player, -711+randInt(1,5), 957+randInt(5,9), 12.4, 90 )

local spawn_skins = { 16, 33, 61, 164, 165 }

local rnd = randInt( 1, #spawn_skins )

if not b then

spawnThePlayer ( player )

setPlayerSkin( player, spawn_skins[ rnd ] )

return

end

fadeCamera(player,true)

end

Link to comment

Please, use tags so that the code is readable. Thanks.

Try this one:

function spawnThePlayer ( player ) 
    local spawn_skins = { 16, 33, 61, 164, 165 } 
    local rnd = randInt( 1, #spawn_skins ) 
    local b = spawnPlayer ( player, -711+randInt(1,5), 957+randInt(5,9), 12.4, 90, spawn_skins[ rnd ] ) 
    if not b then 
        spawnThePlayer ( player ) 
        return 
    end 
    fadeCamera(player,true) 
end 

Link to comment

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...