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

3 comments

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.

0

This code is in a Script, not LocalScript

0

local function onPlayerAdded(player) ??