I tried to make the character invisible by pressing Q but all that did was make the character invisible to me and not to other players. I know it has to do with using game.Players.LocalPlayer, and I really don't know how to make this key press function turn your character invisible to everyone. It may have to do with my script being a LocalScript, but I don't know any other way. Here is my script:
local m = game.Players.LocalPlayer:GetMouse()
local plr = game.Players.LocalPlayer.Character
m.KeyDown:Connect(function(k)
if k == "q" then
if db == true then
for i, Child in pairs(plr:GetChildren()) do
if Child:IsA('Part') or Child:IsA('MeshPart') or Child:IsA('Accessory') then
Child.Transparency = 0.5
end
end
plr.Head.face.Transparency = 0.5
plr.HumanoidRootPart.Transparency = 1
wait(10)
for i, Child in pairs(plr:GetChildren()) do
if Child:IsA('Part') or Child:IsA('MeshPart') or Child:IsA('Accessory') then
Child.Transparency = 0
end
end
plr.Head.face.Transparency = 0
plr.HumanoidRootPart.Transparency = 1
end
end
end)
Yes yes I know I am using KeyDown instead of UserInputService, and I am doing that because I am using the Q key and not any fancy keys.

4 comments
This did not really work.
Have you followed the steps I gave to what you needed? You need the local script under the player (So like StarterPlayerScripts), the server script in ServerScriptService, and a RemoteEvent in ReplicatedStorage. What exactly do you have and did you edit anything?
I edited my post. The problem probably was that the RemoteEvent wasn't loading after the local script ran. See line 06 of my local script code to see the change.
It works now, thanks