If you want to move the position of the menu spawn too in the ObjectSpawnerv2/client.lua at Line 10, add the position arguments. For example this is the bottom right
mainMenu = NativeUI.CreateMenu("Object Spawner", "~b~Select Your Object", 1425, 500)
this is it unedited
mainMenu = NativeUI.CreateMenu(Title, Subtitle, X, Y, TxtDictionary, TxtName)
So i have been customizing the script for my personal use really and added a few objects.
However i would love to have my civs playing it too!
But to add every single ped in the list is kinda to much for me.
How would i remove the ped restriction deal beacuse whenever i try removing checkpedrestriction and stuff like that the script just does not work. And i have been messing around for it just cannot get the hang of it.
Not a pro LUA scripter but i do have my things here and there.
if CheckPedRestriction(GetLocalPed(), pedsList) then
local obj = CreateObject(GetHashKey(objectname), x, y, z-1.90, true, true, true)
PlaceObjectOnGroundProperly(obj)
SetEntityHeading(obj, heading)
FreezeEntityPosition(obj, true)
else
TriggerEvent("chatMessage", "", {255,255,255}, "^1You are not allowed to use this command.")
end
end
I know it is something in here but i just dunno how to safely remove the whole ped restriction without having the whole script broken…
Oh and @PolakenZigeuner
You need to be any of the peds that is in your pedlist. If not you cannot use the menu.
Here you go. Ive removed the ped check for you just replace your code with the following.
Summary
local Player = GetPlayerPed(-1)
local x, y, z = table.unpack(GetEntityCoords(Player, true))
local heading = GetEntityHeading(Player)
RequestModel(objectname)
while not HasModelLoaded(objectname) do
Citizen.Wait(1)
end
RegisterCommand('barrier2', function(source, args)
--[ Spawns Police Barrier ]
SpawnObject('prop_barrier_work05')
end, false)
RegisterCommand('barrier', function(source, args)
--[ Spawns Work Barrier ]
SpawnObject('prop_mp_barrier_02b')
end, false)
RegisterCommand('cone', function(source, args)
--[ Spawn Traffic Cone ]
SpawnObject('prop_mp_cone_01')
end, false)
RegisterCommand('ro', function(source, args)
--[ Removes Objects (Standing Close) ]
DeleteOBJ('prop_barrier_work05')
DeleteOBJ('prop_mp_barrier_02b')
DeleteOBJ('prop_mp_cone_01')
TriggerEvent("chatMessage", "", {255,255,255}, "^3Objects(s) deleted.")
else
TriggerEvent("chatMessage", "", {255,255,255}, "^1You are not allowed to use this command.")
end
end, false)
function DeleteOBJ(theobject)
--[ Deletes The Object ]
local object = GetHashKey(theobject)
local x, y, z = table.unpack(GetEntityCoords(PlayerPedId(), true))
if DoesObjectOfTypeExistAtCoords(x, y, z, 0.9, object, true) then
local obj = GetClosestObjectOfType(x, y, z, 0.9, object, false, false, false)
DeleteObject(obj)
end
end
function GetLocalPed()
--[ Grabs The Player Ped (ID) ]
return GetPlayerPed(PlayerId())
end
```