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

GUI button that places a model?

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by
welt101 12
6 years ago

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))
0
Perfect answer! Nep_Ryker 131 — 6y
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"). Diamo_YT 68 — 6y
0
This might help you when making plugins: http://wiki.roblox.com/index.php?title=Tutorial:Plugins welt101 12 — 6y
Ad

Answer this question