Creating your Own Item

How to create your own items

Below is a basic example of an item file

local ITEM = {}

ITEM.Name = "Enter Item Name"

ITEM.Description = "Description of Item"

ITEM.Type = Type

ITEM.UserGroups = {"usergroup1", "usergroup2"} or false

ITEM.BurnOnUse = true/false

ITEM.Model = "models/blue2/blue2.mdl"

ITEM.Rarity = 0

ITEM.DismantleParts = {}

ITEM.RarityName = "Legendary"
ITEM.RarityColor = Color(255, 0, 0)

ITEM.OnEquip = function( wep )

end

wOS:RegisterItem( ITEM )
  • ITEM.Name - The name of the item (Also an identifier for spawning the item, it is recommended you make these unique)
  • ITEM.Description - The description that appears under the item name
  • ITEM.Type - The type of item you want it to be, valid types are:
WOSTYPE.BLUEPRINT -- A blueprint that people may craft certain items with
WOSTYPE.CRYSTAL -- A crystal for a lightsaber
WOSTYPE.HILT -- A hilt for a lightsaber
WOSTYPE.IDLE -- The idle hum for a lightsaber
WOSTYPE.IGNITER -- The ignition sound for a lightsaber
WOSTYPE.VORTEX -- The swing sound for a lightsaber
  • ITEM.UserGroups - The usergroups that can use the item
  • ITEM.BurnOnUse - Should the item disappear when equipped/used
  • ITEM.Model - The world, inventory, and crafting model for the item
  • ITEM.Rarity - How rare is the item? (0 for not able to spawn, 100 for most common)
  • ITEM.RarityName - This name will show up on the Item when players look at it
  • ITEM.RarityColor - We'll use this Color with the Rarity name when its displayed
  • ITEM.OnEquip - What happens when the item is equipped?

Below are some examples of things you can do inside ITEM.OnEquip

wep.UseColor = Color( red, green, blue ) -- Color of lightsaber max is 255 min is 0 easy color picker here https://www.google.com/search?q=color+picker
wep.CustomSettings[ "Blade" ] = "bladename" -- Blade type the lightsaber uses, checkout our Blade pages for more details!
wep.UseHilt = "model path of hilt" -- Hilt model
wep.UseLoopSound = "sound path" -- Idle sound
wep.UseOnSound = "sound path" -- Sound that plays when you ignite the lightsaber
wep.UseOffSound = "sound path" -- Sound that plays when you de-ignite the lightsaber
wep.UseLength = wep.UseLength + wep.UseLength*0.25 -- Length of the lightsaber wep.UseLength is to get the current one the *0.25 multiplies it by 0.25
wep.UseWidth = wep.UseWidth + wep.UseWidth*0.25 -- Width of the lightsaber wep.UseWidth is to get the current one the *0.25 multiplies it by 0.25
wep.UseSwingSound = "sound path" -- Sound that plays when you swing the lightsaber

wikOS powered By wiltOS Technologies