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

Why will my CharacterMesh removing script not work?

Asked by
sngnn 274 Moderation Voter
4 years ago

I'm not sure what the problem is.

local player = game.Players.LocalPlayer
local character = player.Character

for i, v in pairs(character:GetDescendants()) do
    if v.ClassName == "CharacterMesh" then
        v:Destroy()
    end
end

By the way, the script is in StarterCharacterScripts!

1 answer

Log in to vote
0
Answered by 4 years ago

Instead of ClassName, use IsA. So on line 5 you should try this:

if v:IsA("CharacterMesh") then

Let me know if this doesn't work and accept this answer if it worked!

0
Thanks, but sadly it didn't work. Is it because I'm using a LocalScript? sngnn 274 — 4y
Ad

Answer this question