Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make character transparent when they spawn?

Asked by 4 years ago

The goal of this script is to make it so the player is transparent when they spawn but I am not sure where I went wrong. Any help?

01local folder = script.Parent
02local player = folder.Parent
03 
04for index, lookchar in pairs(folder:GetChildren()) do
05    if lookchar ~= script then
06        lookchar.Parent = player
07 
08        player.Character.Torso.Transparency = 1
09        player.Character:FindFirstChild("Left Arm").Transparency = 1
10        player.Character:FindFirstChild("Left Leg").Transparency = 1
11        player.Character:FindFirstChild("Right Arm").Transparency = 1
12        player.Character:FindFirstChild("Right Leg").Transparency = 1
13    end
14end

2 answers

Log in to vote
1
Answered by 4 years ago

Here, you are just making the parts of the character invisible and not the whole player. I just made a simple script as an example :

01game.Players.PlayerAdded:Connect(function(player) -- Calls when the player joins
02 
03    local ServerStorage = game:GetService("ServerStorage")
04    local UserId = tostring(player.UserId)
05 
06    local FolderExisted = ServerStorage:FindFirstChild(UserId)
07 
08    if not FolderExisted then -- Checks if there is no such folder as the condition
09        local Folder = Instance.new("Folder") -- Creates the folder
10        Folder.Parent = ServerStorage -- Parents it to ServerStorage
11        Folder.Name = UserId -- Name it to the player's UserId
12    end
13 
14    -- The next steps will explain why we created this folder
15 
View all 39 lines...

Lemme know if it helps!

0
It's a ServerScript in ServerScriptService. If you want to make them visible, just revert the steps BestCreativeBoy 1395 — 4y
Ad
Log in to vote
1
Answered by 4 years ago

So, first, you want to find out if the player is R6 or R15. Then make all body parts Transparent. Place a Script in Workspace and follow my code:

01local DefaultTransparency = 1 --Modify if needed
02workspace.ChildAdded:Connect(function(Child)
03    local h = Child:FindFirstChild("Humanoid")
04    if h ~= nil then
05        if h.RigType == Enum.RigType.R6 then
06            Child.Head.Transparency = DefaultTransparency
07            Child.Torso.Transparency = DefaultTransparency
08            Child.HumanoidRootPart.Transparency = DefaultTransparency
09            Child["Left Arm"].Transparency = DefaultTransparency
10            Child["Left Foot"].Transparency = DefaultTransparency
11            Child["Right Arm"].Transparency = DefaultTransparency
12            Child["Right Foot"].Transparency = DefaultTransparency
13        else
14            Child.Head.Transparency = DefaultTransparency
15            Child.UpperTorso.Transparency = DefaultTransparency
View all 31 lines...

Hoped this helped!

Answer this question