#how to send the local clones on server

1 messages · Page 1 of 1 (latest)

wheat tide
#

i made a local script that clones the player is there any way to send the clones to the server and make other players see them

local player = game.Players.LocalPlayer
local rs = game.ReplicatedStorage
local event = rs.SandevistanFolder:WaitForChild("SandevistanRemote")
local uis = game:GetService("UserInputService")
local ClonesFolder = game.Workspace:WaitForChild("ClonesFolder")

uis.InputBegan:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.E and processed == false then
local timepassed = tick()
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local function CloneDestroy(clone)
task.wait(0.7)
clone:Destroy()
end
local function CloneCharacter()
if character then
character.Archivable = true
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local clone = character:Clone()
for _, cloneChild in pairs(clone:GetChildren()) do
if cloneChild:IsA("BasePart") then
cloneChild.Anchored = true
cloneChild.CanCollide = false
cloneChild.CollisionGroup = "Clone"
end
end
clone.HumanoidRootPart.CFrame = humanoidRootPart.CFrame
clone.Parent = ClonesFolder
clone.Name = "Clone"

                CloneDestroy(clone)
            end
        end
    end
    while tick() - timepassed < 5 and humanoid.Health > 0 do
        task.spawn(CloneCharacter)
        task.wait(.1)
    end
end

end)

half abyss
#

Remote event obviously

wheat tide
#

ofc, but i mean what do i need to send

half abyss
#

Make the cloning system on the server. After the if statement fire server

wheat tide
#

if i make it on the server side then the clones wont appear right in the player

#

it will have a delay

half abyss
#

There’s no way to fix the delay I think. Just don’t mind it.

wheat tide
#

and i also have the directional movement system that also doesnt work on clones if the code is on server

edgy turretBOT
#

studio** You are now Level 8! **studio

half abyss
#

Btw why don’t you use debris on CloneDestroy function? It’s better instead of task.wait and destroying it you just do debris:AddItem(clone, 0.7)

wheat tide
#

oh its the outdated code

summer umbra
#

You don't really need to send the clones onto the server so that other players can see it, but instead you just need to use bindable event(It's the same as remote events except that instead of it connecting from client to server, it's connecting from a client to another client), so it'll sync well on both your clients and other players. It might not be visible in the server but it'll still be visible on other players

split tusk
#

could work but having it on server would be easier to modify right?

#

are you making a 2077 game?

dusty palm
dusty palm
#

You should not use like local player

#

Fire the sever

#

Send the player with it

#

Do like

#

fireserver(plr)

#

And then do on sever side

#

plr.Character:FindFirstChild(“Humanoid”)