Okay so my GUI looks like this by the way everything works except Invisibility.
Trying to make it were everyone sees you as invisible.
Also code is below image.
Player = script.Parent.Parent.Parent.Parent.Character
function click()
Player.Head.Transparency = 1
Player.RightLeg.Transparency = 1
Player.LeftLeg.Transparency = 1
Player.LeftArm.Transparency = 1
Player.RightArm.Transparency = 1
Player.Torso.Transparency = 1
Player.face.Transparency = 1
end
script.Parent.MouseButton1Click:connect(function() click() end)
--LocalScript
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local invisEvent = ReplicatedStorage:WaitForChild("remote event name here");
function onClick()
invisEvent:FireServer();
end
script.Parent.MouseButton1Click:Connect(onClick);
--ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local invisEvent = ReplicatedStorage["remote event name here"];
function onInvisEventFired(plr)
local char = plr.Character;
for _, v in next, char:GetChildren() do
if v:IsA("BasePart") then --Checks if it's a body part
v.Transparency = 1; --Makes the body part invisible
if v.Name == "Head" then
v.face.Transparency = 1; --Makes the face invisible
end
end
end
end
invisEvent.OnServerEvent:Connect(onInvisEventFired);
I’d recommend implementing some security measures on the event firing, but I’m not sure how your admin gui works.
So basically, i just put a starter character in the starter player and changed the children to the same name with out no space and then tried your script and put it on a gui and it works.