How to change a model's parent when interacted with gui roblox studio

Hello I’ve been trying to change a model’s parent when interacted with a gui button and it just wouldn’t work can anyone help me, Thank you!

Here is the code i tried:

local Buton = game.StarterGui.SunucuGui.Frame.Oldur


Buton.MouseButton1Click:Connect(function(plr)

    local Model = script.Parent

    wait(0.1)

    Model.Parent = Workspace
    wait(3)
    Model.Parent = ReplicatedStorage

    script.Enabled = false
    wait(0.1)
    script.Enabled = true
end)
3 Likes

Could we see the explorer tab for your game? Also, it could be that you are trying to change the parent of the model on a local script, which doesn’t work for some things.

2 Likes

check the archived property of the model and set it to false, and as the other guy said: use a server script

2 Likes