Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Invisibility Being ... Visible?

So I already know how to make the player transparent (I used a local script). However, when I looked at my alt account I realized the invisibility only worked for me on my main account (not my alt). Is there a way that I could fix this?

My script:

local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:Wait() local UserInputService = game:GetService("UserInputService") local Key = "E" 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 UserInputService.InputBegan:Connect(function(Input,GameStuff) if GameStuff then return end if Input.KeyCode == Enum.KeyCode[Key] then if Visible then Visibility(false) Visible = false else Visibility(true) Visible = true
end end end) game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) for i,Child in pairs(Character:GetChildren()) do if Child:IsA('Part') or Child:IsA('MeshPart') then Child.Transparency = 1 end end wait(2) for i,Child in pairs(Character:GetChildren()) do if Child:IsA('Accessory') then Child:Destroy() end end Character.Head.face:Destroy() end) end)

3 comments

0

My bad. I didn't know how to set up the script correctly.

1

A local script only works.. locally. Use a server script.

0

Ok I'll try that. Thanks.

1 answer

✓ Accepted answer

You must always remember to use server scripts for server changes and only use local for keeping local variables or for client rendering.

1 comment

0

thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.