I want to make the model change with each spawn. But the same model appears, and writes variables from the table to the console. What to do?
Console
Print Model: models/props_c17/TrapPropeller_Blade.mdl
Print Model: models/props_c17/TrapPropeller_Engine.mdl
Print Model: models/props_vehicles/carparts_axel01a.mdl
Print Model: models/props_lab/reciever01d.mdl
Print Model: models/props_c17/TrapPropeller_Lever.mdl
Print Model: models/props_c17/streetsign005b.mdl
Print Model: models/props_c17/TrapPropeller_Blade.mdl
Print Model: models/props_c17/TrapPropeller_Blade.mdl
Print Model: models/props_lab/reciever01a.mdl
Print Model: models/props_c17/streetsign001c.mdl
Print Model: models/props_lab/reciever01d.mdl
Print Model: models/props_lab/reciever01d.mdl
Print Model: models/props_lab/reciever01a.mdl
Print Model: models/props_junk/MetalBucket01a.mdl
Print Model: models/props_vehicles/carparts_axel01a.mdl
Code(NOT FULL)
local models = {
"models/props_c17/TrapPropeller_Blade.mdl",
"models/props_c17/TrapPropeller_Lever.mdl",
"models/props_c17/TrapPropeller_Engine.mdl",
"models/props_c17/streetsign001c.mdl",
"models/props_c17/streetsign005b.mdl",
"models/props_c17/streetsign005c.mdl",
"models/props_junk/MetalBucket01a.mdl",
"models/props_lab/reciever01a.mdl",
"models/props_lab/reciever01d.mdl",
"models/props_vehicles/carparts_axel01a.mdl"
}
function UpdateEnt()
model = table.Random(models)
print("Print Model: "..model)
end
ENT.lootModel = model
I have solved the problem.
Instead of using ENT.lootModel try ENT:SetModel
If you wanted to try to keep the lootModel var try this:
ENT.lootModel
self:SetModel(lootModel)
Sorry, you need to Log In to post a reply to this thread.