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

Making the head of a character... the only thing?

Asked by 4 years ago

Hello!

I have a idea for a game, but dont know one thing. Can i make a character... just a head?

i tried writing a simple script to make transparent and non-CanCollide all parts that was NOT the head, but that did nothing, really.

How would i go about doing this?

1 answer

Log in to vote
3
Answered by
DrShockz 233 Moderation Voter
4 years ago

That sounds like an interesting game idea! Here is a script in detail :)

Script: (Make sure the script is a ServerScript inside ServerScriptService)

local plr = game:GetService("Players")  --[ Defines the Player Service.

local function invis(char)  --[ Invisiblilty Function
    for a,b in pairs(char:GetChildren()) do  --[ Gets all children of the player's character.
        if b:IsA("MeshPart") and b.Name ~= 'Head' or b:IsA("BasePart") and b.Name ~= 'Head'  then  --[ Checks if the part is a Part and  not the head
            b.Transparency = 1 --[ Transparent 
            b.CanCollide = false --[ No Collisiosns
        end
    end
end

plr.PlayerAdded:Connect(function(player)  --[ Runs when player is added
    player.CharacterAdded:Connect(invis) --[ Waits until that player's character is added
end)

Please be sure to mark this as the answer if this worked for you :)

Have a great day! - DrShockz

0
i will try it later, thank you! codingMASTER398 52 — 4y
0
This aint work, the upper and lower torso keep on being cancollide! codingMASTER398 52 — 4y
Ad

Answer this question