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

How do i clone something using Filtering enabled?

Asked by 7 years ago
Edited 7 years ago

i know how to clone and stuff, but when you go to clone something while using FE, it clones but gets deleted after a while. i even tried using remote events and it still got deleted.

Please help

Local script

local remote = game:GetService('ReplicatedStorage'):WaitForChild('RemoteEvent')
local hat = game:GetService('ReplicatedStorage'):WaitForChild('Bighead')
local cam = game.Workspace.CurrentCamera

local player = game.Players.LocalPlayer
local char = player.Character



remote:FireServer({hat, cam})

Server script

local partRemote = Instance.new('RemoteEvent')
local replicated = game:GetService('ReplicatedStorage')
partRemote.Parent = replicated


partRemote.OnServerEvent:connect(function(player, arguments)
    local bighead = arguments[1]:Clone()
    bighead.Parent = arguments[2]
end)

1 answer

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

Don't replicate the actual object as an argument. Replicate it's name, then reference it on the server and clone it that way.

Also, the camera is only accessible from the Client. Attempting to parent the hat to the Camera from the server makes the whole RemoteEvent process redundant, since you can do that on the client anyways.

Localscript;

local remote = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local hat = game.ReplicatedStorage:WaitForChild("Bighead")
local cam = workspace.CurrentCamera
local player = game.Players.LocalPlayer

repeat wait() until player.Character

local char = player.Character

remote:FireServer(hat.Name)

Serverscript;

local replicated = game.ReplicatedStorage;
local partRemote = Instance.new("RemoteEvent",replicated)

partRemote.OnServerEvent:connect(function(player, argument)
    --Reference it on the server
    local bighead = replicated:WaitForChild(argument);
    bighead:Clone().Parent = workspace;
end)
0
still doesnt work, it clones yes but gets deleted afterwards trubudist 40 — 7y
0
I'm afraid there's just no reason for that. Make sure there are no scripts interfering. Check your hat object for viruses. You could also try just scrapping this whole RemoteEvent and cloning the hat into the Camera from the client. Goulstem 8144 — 7y
0
If there's no reason for the rest of the server to see the hat object then you can go without replicating this :) Goulstem 8144 — 7y
Ad

Answer this question