How do i make something clone into the server?

So i have a part i want to clone. When you clone something from the replicated storage it will go into the client side. How do i make it go into the server side?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CookieEvent = ReplicatedStorage:WaitForChild("CookieEvent")
local Cookie = ReplicatedStorage:WaitForChild("Cookie")
local Button = script.Parent

Button.MouseButton1Click:Connect(function()
    CookieEvent.OnClientEvent:Connect(function()
    local Clone = Cookie:Clone()
    Clone.Parent = workspace    
    end)
end)

In the cookie heres the server script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CookieEvent = ReplicatedStorage:WaitForChild("CookieEvent")
CookieEvent:FireClient

make it so the server clones it and not the client

1 Like

oh. Okay thanks. Im going ot try that.

Just as Happygamer1983 said, clone it on the server. Unless you have other uses in mind, you wouldn’t need a RE just to clone something to the server from the server.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cookie = ReplicatedStorage:WaitForChild("Cookie")
local Button = script.Parent

local ClickDetector = Instance.new("ClickDetector")
ClickDetector.Parent = Button
ClickDetector.MaxActivationDistance = 10

ClickDetector.MouseClick:Connect(function(player)
	if player then
		local clone = Cookie:Clone()
    	clone.Parent = workspace
	end 
end)

1 Like