What I'm trying to do is make my local script into a working server 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)

1 comment
please fix this and put it into a block of code