Yo. I tried making a script that makes me invisible to just one player, using a lock system and a ClientEvent. Didn't work, no errors appear. Here's the code:
LOCK SYSTEM
local players = game.Players local player = players.LocalPlayer local mouse = player:GetMouse() local plrtarget = player.PlayerGui.Values.Targett mouse.KeyDown:connect(function(key) if key == "l" then local target = mouse.Target local plr = players:GetPlayerFromCharacter(target.Parent) if plr then print(plr.Name) plrtarget.Value = plr.Name end end end)
LOCAL SCRIPT FOR DISAPPEARING
local players = game.Players local player = players.LocalPlayer local mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key == "z" then print("DISAPPEAR GO") --if player.Level.Value >= 5 then local target = player.PlayerGui.Values.Targett.Value game.ReplicatedStorage.RemoteEvents.InvisibilitySkill.Disappear:FireServer(target) --end end end)
SERVERSCRIPT
game.ReplicatedStorage.RemoteEvents.InvisibilitySkill.Disappear.OnServerEvent:Connect(function(player, target) print("DISAPPEAR ARRIVED AND GOES AGAIN") game.ReplicatedStorage.RemoteEvents.InvisibilitySkill.Disappear1:FireClient(target, player) end)
LOCAL SCRIPT
game.ReplicatedStorage.RemoteEvents.InvisibilitySkill.Disappear1.OnClientEvent:Connect(function(target, player) local db = false local Character = player.Character print("DISAPPEAR ARRIVED") print(player.Name) if db == false then db = true for i,v in pairs(Character:GetDescendants()) do -- loop through everything in the character if v:IsA("BasePart") or v:IsA("Decal") then -- if it is a part v.Transparency = 1 -- make it invisible end end else db = false for i,v in pairs(Character:GetDescendants()) do -- loop through everything in the character if v:IsA("BasePart") or v:IsA("Decal") then -- if it is a part v.Transparency = 0 -- make it invisible end end end end)
Help please!