All that does is fade the player into invible I want the player the be half inviable and everyone else to see the player as invisable
Wait the serverside fades not the cleint
The serverside makes the cleint fully invisable and does not make it half invisable
did you atleast try the code?
Yes I did, the button makes the player half invisable but when I fire the server it makes the client fully invisable.
I suggest replicating the transparency to other clients not by the server, but firing it to the player specifically. Also to the player who is invisible you should check if the client is theirs and if it is then just set their body parts transparency to 0.5
.
sorry, heres the fixed version:
local characterTransparencyConnections = {}
-- use stopTransparencyConnection() to stop it from changing the transparency to 0.5
function stopTransparencyConnection()
for _, connection in pairs(characterTransparencyConnections) do
if connection.Connected then
connection:Disconnect()
end
end
end
script.Parent.MouseButton1Click:Connect(function()
local character = game.Players.LocalPlayer.Character
for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("Decal") then -- if it is a part
part.LocalTransparencyModifier = 0.5
part.Transparency = 0.5
table.insert(characterTransparencyConnections, part:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
part.LocalTransparencyModifier = 0.5
end))
table.insert(characterTransparencyConnections, part:GetPropertyChangedSignal("Transparency"):Connect(function()
part.Transparency = 0.5
end))
end
end
game.ReplicatedStorage.Invis:FireServer()
end)
what? if we do fire to the player specifically only that player would get the change and it would defeat the whole purpose of being invisible to other players
You wouldnât fire to the player specifically, you would fire it to all the clients.
ah i see, but what would be the purpose of this anyways? sound like its just more lines of code to acheive the same result
Youâre right, it wouldnât really be needed and would achieve the same effect. It was just what I was thinking as a solution, but itâs mainly used for visuals so it wouldnât lag the server, and it would be smoother on the client.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.