Ok so I have this script that should be making characters transparent when they join the server, however it doesn't seem to be working. I also have no idea how to make the hats transparent along with it. Here's the script I have so far:
local Players = game:GetService("Players") function onPlayerAdded(player) game.Players.LocalPlayer.Character.Head.Transparency = 0.7 game.Players.LocalPlayer.Character.Torso.Transparency = 0.7 game.Players.LocalPlayer.Character["RightArm"].Transparency = 0.7 game.Players.LocalPlayer.Character["RightLeg"].Transparency = 0.7 game.Players.LocalPlayer.Character["LeftArm"].Transparency = 0.7 game.Players.LocalPlayer.Character["LeftLeg"].Transparency = 0.7 end Players.PlayerAdded:connect(onPlayerAdded)
It used to just make my head and torso transparent, but now it doesn't even do that. It also tells me that "RightArm isn't a valid member of model", which I can't understand (unless it's supposed to be "Right Arm"
instead of "RightArm"
. I just can't seem to figure out what i'm doing wrong. I'm still very basic with LUA so any help would be much appreciated.
~MrTurkeys
At first you start out good, like with the function and all, but then, for some reason, you make it game.Players.LocalPlayer
instead of player
. Oh, and you also forgot the spaces in the name of the limbs of the character.
Here, this should work:
local Players = game:GetService("Players") Players.PlayerAdded:connect(function(player) player.Character.Head.Transparency = 0.7 player.Character.Torso.Transparency = 0.7 player.Character["Right Arm"].Transparency = 0.7 player.Character["Right Leg"].Transparency = 0.7 player.Character["Left Arm"].Transparency = 0.7 player.Character["Left Leg"].Transparency = 0.7 end)
Still doesn't work? Try this instead:
local Players = game:GetService("Players") Players.PlayerAdded:connect(function(player) local Character=workspace:WaitForChild(player.Name) Character.Head.Transparency = 0.7 Character.Torso.Transparency = 0.7 Character["Right Arm"].Transparency = 0.7 Character["Right Leg"].Transparency = 0.7 Character["Left Arm"].Transparency = 0.7 Character["Left Leg"].Transparency = 0.7 end)
So, you should be using a Regular Script
so you can make changes to the players on the Server
. Even if FE
is disabled, you should be using a Regular Script
. I would suggest placing the script in ServerScriptService
.
I would also suggest a pairs loop
to get every part in the character, setting the transparency. We can use the IsA()
function to check if the thing in the character is a part.
Next thing I would suggest is waiting for the Character to load with the CharacterAdded Event
.
Example,
local Players = game:GetService("Players") Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) for i,v in pairs(char:GetChildren()) do if v:IsA("Part") then v.Transparency = 0.7 end end end) end)
Good Luck!