Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Multiple model spawner with clickdetector failiure. Does anyone know how to do this?

I want to make a button that has a clickdetector that can spawns a random model, but literally theres nothing on how to do it, can anyone tell me a script that tells me that's recent? Edit: to be more clear, I need a script that spawns a random Model out of many from ReplicatedStorage to a part shows where the models spawn, but unfortunately I am unable to find one

2 comments

0

Could you go into a little more detail? So far my understanding is you want to be able to click on the clickdetector and have multipe (more than 1) models spawn in. Where do you want these models to spawn in? where are you storing these models?

0

I edited it to be more clear u should relook if u want

1 answer

Before writing this script, you muse have a PrimaryPart set for your model in order to move it to any position and place your model in ServerStorage for safe keeping

ServerStorage = game:GetService('ServerStorage') -- getting the ServerStorage
model = ServerStorage:WaitForChild('Model') -- refrencing your model

ClickDetector.MouseClick:connect(function()
	local GoalPosition = part.Position -- Set this variable as the part position where you want your model to spawn in
	local ModelClone = model:Clone() -- Cloning the model that you want to spawn in
	ModelClone.Parent = workspace -- placing the model onto workspace
	ModelClone:MoveTo(GoalPosition) -- Placing your model to the position that you want
end)

2 comments

0

Abusedcocopuff4, where do i put the script and what should I name the part that positions it

0

You can put the script inside the click detector and name the part to whatever you want.

This discussion is preserved as it was. New answers, comments, and votes are closed.