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

GUI button that places a model?

I am making a plugin called "City Maker" and I made the plugin in the ServerStorage as well as the Apartment model that I made, I have made a GUI buttun that is supposed to place down a model (the Apartment) but it does not. If somebody tells me the code I have to insert into the button it would solve all my problems.

Here is the code I have so far:

Instance.new("ClickDetector", script.Parent)
function onClick(player)
local model = game.ServerStorage.Apartment

local backup = model:clone()

while true do
	wait(5)


	



	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()

end

end

1 answer

Take a look at the MoveTo function of Model.

local backup = game.ServerStorage:WaitForChild("Apartment")
model = backup:Clone()
model.Parent = game.Workspace
model.MoveTo(Vector3.new(x,y,z))

3 comments

0

Perfect answer!

0

When I click the button it still does not work. I also noticed that when somebody else uses the plugin it won't place the model because they don't have it. So I made some modifications. I have an Infection that I can't get rid of and so on line 1 I made it to local backup = game.ServerStorage:WaitForChild("Apartment").

0

This might help you when making plugins: http://wiki.roblox.com/index.php?title=Tutorial:Plugins

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