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

how would you recall a model out of server storage?

Asked by
Limk 5
8 years ago

For an example, a map changer, how would I do that? I want to display a model from SS and recall it so it is visible to people

0
Do you want to clone it or move it? AZDev 590 — 8y
0
pie = ServerStorage.Model:Clone(); pie.Parent = workspace; ? randomsmileyface 375 — 8y

1 answer

Log in to vote
0
Answered by
Wutras 294 Moderation Voter
8 years ago

This is really simple. You just need the method :Clone() or changing of the Parent. You may connect this to chatting or buttons. I'll show it to you with the following script.

function InsertModelFromSS (modelname)
    if game.ServerStorage:FindFirstChild (modelname) then
        game.ServerStorage[modelname]:Clone ().Parent = workspace
    end
end

game.Players.PlayerAdded:connect (function (plr)
    plr.Chatted:connect (function (msg)
        InsertModelFromSS(msg)
    end)
end)

Cd = Instance.new ("ClickDetector", workspace.Baseplate)
Cd.MouseClick:connect (function(plr)
    game.ServerStorage:GetChildren ()[math.random(1, #game.ServerStorage:GetChildren)]:Clone().Parent = workspace
end)

If you have any questions, feel free to ask.

Ad

Answer this question