forked from Simnation/Main
edit
This commit is contained in:
parent
be02d05ba8
commit
fc7ea910e9
35 changed files with 11992 additions and 1 deletions
17
resources/[tools]/mt_lib/modules/createProp/client.lua
Normal file
17
resources/[tools]/mt_lib/modules/createProp/client.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
---@param model string
|
||||
---@param coords table
|
||||
---@param heading number
|
||||
---@return integer | nil
|
||||
local createProp = function(model, coords, heading)
|
||||
lib.requestModel(model, 5)
|
||||
local prop = CreateObject(GetHashKey(model), coords.x, coords.y, coords.z, false, false, false)
|
||||
if DoesEntityExist(prop) then
|
||||
SetEntityHeading(prop, heading)
|
||||
FreezeEntityPosition(prop, true)
|
||||
return prop
|
||||
else
|
||||
print("Failed to create prop: " .. model)
|
||||
return nil
|
||||
end
|
||||
end
|
||||
exports("createProp", createProp)
|
Loading…
Add table
Add a link
Reference in a new issue