How should i make a model appear on workspace when you click on a button (this is for a car inserter plugin)
local model = game.ServerStorage.ModelName
local buton = script.Parent -- script inside the button
button.MouseButton1Click:Connect(function()
model:Clone().Parent = workspace
--model:MoveTo(part.Position)
end)
1 Like
This won-t work bc:
My button is on a GUI.
As i said its for a plugin.
This needs more description. The model should be only for one player or visible for everyone?
- Create a button
- Add an onclick listener
- Send remote event to the server
- Server will spawn your model.
If the model is visible for one person, so client-side model,.you can skip the part with sending remote event and every other server interaction.
How to add listener to your button, the simplest solution is to add local script under such button and add listener to the Activated
signal.
pls read it is for a car inserter plugin!!!
I already gave you the solution for both situations.
I don’t know how to make that, could u help me pls?