phuochung14

Command to give player_name some items

Recommended Posts

phuochung14    0

i need give some item to a player by command

i google and found command:

UserToPlayer("player_name").components.inventory:GiveItem(GLOBAL.SpawnPrefab("name_of_item"))

but GLOBAL not declare at console.

i want a command can use at dedicated console,any solution?

Edited by phuochung14
spelling correction

Share this post


Link to post
Share on other sites
Daniel86268    389

I never tried it, but try doing it without the GLOBAL. part. So just

UserToPlayer("player_name").components.inventory:GiveItem(SpawnPrefab("name_of_item"))

 

  • Like 1

Share this post


Link to post
Share on other sites
phuochung14    0
1 hour ago, Daniel86268 said:

I never tried it, but try doing it without the GLOBAL. part. So just


UserToPlayer("player_name").components.inventory:GiveItem(SpawnPrefab("name_of_item"))

 

It's work, thank you!

Share this post


Link to post
Share on other sites

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