It just refused to work. It is like it doesn't even give me an error.. Even though one of the teams is true during the event.
wait(.5)
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local Key = "Q"
local Visible = true
local function Visibility(Var)
if Var then
if plr.Team == ("Foundation Personnel") or plr.Team == ("Internal Security Department") then
wait(.8)
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
end
else
if plr.Team == ("Foundation Personnel") or plr.Team == ("Internal Security Department") then
wait(.8)
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
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)
Any ideas?

1 comment
What is the reason for: "if GameStuff then return end"?