Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make a block that spawns chairs?

Asked by 7 years ago

I need help with this script, I want it so that the chair spawns non stop, and spawns really fast without the others disappearing....how can I make this block with a script that does just that?

0
While loop just copying a chair over from server storage or something, then using the MoveTo method to move the chair models to the part's location. M39a9am3R 3210 — 7y
0
Can you explain how that? I need a script to loop it. Jarells 5 — 7y
0
Can you post the script? User#5423 17 — 7y
0
I'll post a scripted answer. MrMinecraft998887 87 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

PUT THIS SCRIPT INTO THE BLOCK THAT SPAWNS THE CHAIRS, NOTHING ELSE--- Making it Continuously spawn chairs will cause lag but let's do it anyways. This entire script is case sensitive so spell everything right, including caps.

------------------------------------------------------SETUP------------------------------------------------------------------ You will need to make a Folder into the ReplicatedStorage and name it Assets. Take you chair model and put it in the Assets Folder, then name it Chair.

------------------------------------------------------SCRIPT-----------------------------------------------------------------

local chair = game.ReplicatedStorage.Assets.Chair

script.Parent.Touched:connect(function()
    while true do
        local newChair = chair:Clone()
        newChair.Name = "Chair"
        newChair.Parent = game.Workspace
        newChair:MakeJoints()
        newChair:MoveTo(part.Position) -- Change part to the block you want the chairs to spawn at
    end
end)

-----------------------------------------------------EXPLANATION---------------------------------------------------------This script is telling the server that when the block is touched to activate the loop. When the loop is activated it creates a clone of the chair then moves it to Workspace, then the block you would like it to "Spawn" on.

------------------------------------------------------WARNING-------------------------------------------------------------- This loop will NEVER END. If you want it to stop you would have to shutdown all servers then rejoin. This loop creates A LOT of lag so be cautious.

If this script doesn't work let me know in the comments of this answer

HAVE FUN

Ad

Answer this question