So I’m making a Police Menu and for my third part I’m doing props/objects but it doesn’t work. I don’t know if I made a silly mistake or if I’m missing any coding or ETC. So here is what I got. If you know what’s wrong please help me out.
-- Used in "ThirdItem"
props = {
"prop_bowling_ball"
}
function ThirdItem(menu)
local propsList = NativeUI.CreateListItem("~b~Props", props, 1)
menu:AddItem(propsList)
menu.OnListSelect = function(source,args)
if item == propsList then
local selectedProp = item:IndexToItem(index)
local x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
RequestModel('prop_bowling_ball')
while not HasModelLoaded('prop_bowling_ball') do
Citizen.Wait(1)
end
local cone = CreateObject('prop_bowling_ball', x, y, z, true, true, true)
PlaceObjectOnGroundProperly(object)
notify("Spawned "..selectedProp)
end
end
end