This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

Giving items

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
FRU1TSALAD
Meatbag
Posts: 3
Joined: Wed Apr 18, 2018 10:53 pm
Title: The Great Bamboozler
SFD Account: Lol9er9er
SFD Alias: FRU17 $ALAD
Started SFD: October 2016
Location: Severn,MD
Age: 23
Contact:

Giving items

Post by FRU1TSALAD » Sat Apr 28, 2018 3:47 am

Is there a command that allows items such as pistols to be given to players? I am making a map that requires this
0 x
"You can catch flies with honey, but you'll catch more honeys bein' fly"

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1887
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 36

Post by Gurt » Sat Apr 28, 2018 11:36 am

Use the IPlayer.GiveWeaponItem(WeaponItem weaponItemToGive ) function. See the ScriptAPI for more details.

IPlayer plr = ...;
plr.GiveWeaponItem(WeaponItem.PISTOL);
0 x
Gurt

Locked