Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My custom commands script isn't working?

Everything is working, except for when I use smallhead. It doesn't remove the hats, which is annoying. Help?

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        if msg == "bighead" then
            player.Character.Head.Mesh.Scale = Vector3.new(3, 3, 3)
		elseif msg == "smallhead" then
			player.Character.Head.Mesh.Scale = Vector3.new(0.7, 0.7, 0.7)
		elseif msg == "normalhead" then
			player.Character.Head.Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
		elseif msg == "respawn" then
			if player.Character.Humanoid.Health > 0 then
				player:LoadCharacter()
			end
		elseif msg == "sparkles" then
			if not player.Character.Torso:FindFirstChild("Sparkles") then
				local sparkles = Instance.new("Sparkles", player.Character.Torso)
			end
		elseif msg == "fire" then
			if not player.Character.Torso:FindFirstChild("Fire") then
				local fire = Instance.new("Fire", player.Character.Torso)
			end
		elseif msg == "shutdown" then
			if player.Name == "Relatch" then
				for i, v in pairs(game.Players:GetPlayers()) do
					v:Kick()
				end
			end
        end
    end)
end)

2 comments

0

Did you copy my script from yesterday?:3 jk

0

maybe :3

1 answer

✓ Accepted answer

Hats are located inside your Character and not inside your Player.

Try L7

            for i, v in pairs(player.Character:GetChildren()) do

1 comment

0

already fixed this, but thanks for the answer!

This discussion is preserved as it was. New answers, comments, and votes are closed.