How can I make my invisibility script visible to everyone else

Hello, I was wondering how I could make my invisible script make you invisible to everyone else?
Because right now when you’re invisible the effects only apply to your screen or the client. So could anyone help me fix this? (Also as a note this is a local script inside of a TextButton)

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local Visible = true
local function Visibility(Var)
if Var then
for _, Part in pairs(char:GetDescendants())do
if Part:IsA("BasePart") or Part:IsA("MeshPart") then
Part.Transparency = 0
char.Head.face.Transparency = 0
char.HumanoidRootPart.Transparency = 1 
end
end 
else
for _, Part in pairs(char:GetDescendants())do
if Part:IsA("BasePart") or Part:IsA("MeshPart") then
Part.Transparency = 1
char.Head.face.Transparency = 1 
end
end   
end 
end
script.Parent.MouseButton1Click:Connect(function(GameStuff)
	script.Parent.BackgroundColor3 = Color3.new(255,0,0)
		script.Parent.Text = "Visible"
if GameStuff then return end
if Visible then
Visibility(false)
Visible = false 
	else
	script.Parent.BackgroundColor3 = Color3.new(0,255,0)
	script.Parent.Text = "Invisible"
	Visibility(true)
	Visible = true
	end
	end)

You have to fire a remote event to the server.

1 Like

I’m still a beginner with the whole remote event thing I know I have to put it at the end but I don’t know what to put in the ServerScript and at the end of the client.

make a local script wich gets the local player make a remote event in replicated storage type in the local game.ReplicatedStorage.RemoteEvent:FireServer(here the player value)
then in server script service in a script game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(Function(then player)
– You Invisible script
end)
that should be what your looking for

2 Likes

You will need to make RemoteEvent that fires in your function, but delete invisible thing. When player clicks on button, or whatever it fires RemoteEvent that in ReplicatedStorage.

Put this in your localscript in GUI:

game:GetService("ReplicatedStorage").RemoteEvent:FireServer(Visible) --visible variable, you just change on true or false
--you need to put this twice, when visible true and false in your function

then we just create script in the ServerScriptService:

game:GetService("ReplicatedStorage").RemoteEvent.OnServerEvent:Connect(function(player,visiblity)
--we got player and visiblity
--first is always player
if visiblity == true then
--Character Visible
elseif visiblity == false
--Character Invisible
end)
1 Like

yes thanks @Fel1x_FX and @CoolSpaace you guys helped me a lot with this so thanks this was a big problem in my game.

2 Likes