Issue with local parts

Hello!

I made script that takes model from ReplicatedStorage and puts it into CurrentCamera to make it invisible to other players when i touch a part, but when i touch it model do not appear. I tested and i see that my model do not appear when im in Client, but when i change it to Server model is in there. Everything i good just model do not appear.
Please say what i do wrong.

Heres images if you dont understand
Screenshot_129 Screenshot_130
Screenshot_131 Screenshot_132

Heres my script if needed:

local Players = game:GetService("Players")
local deb = false
local camera = game.Workspace.CurrentCamera

function onTouched(plr)
if deb == false then
	game.Workspace.CurrentCamera:ClearAllChildren()
	deb = true
	local torso = plr.Parent:FindFirstChild("Torso")
	local levelC = game.ReplicatedStorage.MAPS.Level2:Clone()
	local teleportplace = levelC:FindFirstChild("Speed")
	levelC.Parent = camera
	wait(0.3)
    torso.CFrame = teleportplace.CFrame
    local player = Players:GetPlayerFromCharacter(plr.Parent)
    player:FindFirstChild("leaderstats").Stage.Value = player:FindFirstChild("leaderstats").Stage.Value == 2
    wait(1)
    deb = false
	else
	
end

end

script.Parent.Touched:connect(onTouched)
1 Like

Its likely not working because you are putting the model in the camera. The camera isn’t a container and it isn’t one that can cross the sever and client boundary. Things placed there don’t replicate to the client. As stated on the wiki:

This item is not replicated across Roblox’s server/client boundary.


it might be better to do something else, like , hide the model using the transparency of its parts.

1 Like

but i saw video from alvin blox, he used camera and it worked.

i’m not sure which of his videos you are referring to.

1 Like

this one https://www.youtube.com/watch?v=5J6xWj4Oxdk

1 Like

Yes, he is placing them in the camera, but he’s doing so from the client, which you are not doing , you are doing it from the server (it appears), which does not replicate to the client. Anything that is placed in the camera from the server does not show up on the client and vice versa.

1 Like

You’d probably need to put that script onto a localscript because it’s only being seen from one player.

oh my bad. Thanks for helping me

1 Like