When the tool is equipped, it will make the player invisible and invincible, when it is unequipped again, it will make the player visible again. But, the player doesn't turn normal again after unequipping the tool.
script.Invincible.OnServerEvent:Connect(function(player, tool)
local function makeInvisible()
for i,v in pairs(player.Character:GetChildren()) do
if v.ClassName == "MeshPart" or v.ClassName == "Part" then
v.Transparency = 0.5
end
end
end
player.Character.Humanoid.MaxHealth = math.huge
player.Character.Humanoid.Health = math.huge
player.Character.HumanoidRootPart.Transparency = 1
makeInvisible()
end)
script.RemoveInvincible.OnServerEvent:Connect(function(player, tool)
local function makeVisible()
for i,v in pairs(player.Character:GetChildren()) do
if v.ClassName == "MeshPart" or v.ClassName == "Part" then
v.Transparency = 0
end
end
player.Character.Humanoid.MaxHealth = 100
player.Character.Humanoid.Health = 100
makeVisible()
end
end)

2 comments
Where's the localscript? So we see what's going on :D
Are you sure the RemoveInvincible event gets fired? Try adding a print at the top of its handler