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

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

Asked by 5 years ago
Edited 5 years ago

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

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? Wavycane 0 — 5y
0
I edited it to be more clear u should relook if u want User#30241 0 — 5y

1 answer

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

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)
0
Abusedcocopuff4, where do i put the script and what should I name the part that positions it User#30241 0 — 5y
0
You can put the script inside the click detector and name the part to whatever you want. AbusedCocopuff4 105 — 5y
Ad

Answer this question