hi i am new to creating roblox games and i wanted to do a tycoon, but droppers will spawn custom models so i found this script to spawn bricks but i want to change it to models that i have in my map
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,1) p.BrickColor = BrickColor.new(26) p.BottomSurface = 0 p.TopSurface = 0 p.Name = "Part" p.Parent = script.Parent end while true do wait(2) fire() end
can someone edit the script and give me one that works plz ?
Not going to edit it for you, but a way to do this would be to make sure that you have set the PrimaryPart of a model (in properties), then something along the lines of..
local model = game:GetService("ServerStorage").path.to.model:Clone() model:SetPrimaryPartCFrame(path.to.spawn.position)
instead of the whole Instance.new() (and then modifying the instances properties)
Just write the following code:
function fire() --Define the function local model = game.Workspace.ModelName -- Define where the model is placed local modelClone = model:Clone() -- Makes a duplicate of the model end while true do -- In a constant loop fire() -- The function runs cloning the model every 1 second wait(1) -- Waits 1 second before going to the top and firing the function again! end
Hopefully this helped!