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

Having trouble with CharacterAppearanceLoaded. Help?

Asked by 5 years ago

So I created a script which gives players some localscripts everytime they spawn. I have been testing It for a while, and I realized after running it in client mode, It doesnt work with players without any clothes. I have been looking for information and I found out it is a roblox issue which has not been fixed yet.

Here's my script

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAppearanceLoaded:Connect(function(character)
        setPlayer(character)
    end)
end)

function setPlayer(char)
    for _,setting in pairs (script:GetChildren()) do
        local c = setting:Clone()
        c.Parent = char
        if c.ClassName == "LocalScript" then
            c.Disabled = false
        end
    end
end

I just don't know what to do. I tried cloning the scripts into the players directly with "player.Character", but It doesnt work

0
PlayerAdded won't fire for the client running the local script. But if you're going to modify their character you might as well do it from the server. User#19524 175 — 5y
0
This code is in a Script, not LocalScript masterjosue1998 116 — 5y
0
local function onPlayerAdded(player) ?? ABK2017 406 — 5y

Answer this question