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

How do I make a player spawn with a brick attached to them?

Asked by 5 years ago

Kind of like those custom hats that people use. I've been trying to figure this out for a long time.

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

If I wanted to attach a brick to someone, I would use a Weld Constraint cause I'm a monster.

function weld(p0, p1, p)
    local weld = Instance.new("WeldConstraint")
    weld.Part0 = p0
    weld.Part1 = p1
    weld.Parent = p
end

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local root = character:WaitForChild("HumanoidRootPart")

        if root then
            local newPart = Instance.new("Part")
            part.CFrame = root.CFrame * CFrame.new(0, 0, - 5)
            part.Parent = workspace

            weld(root, newPart, root)
        end
    end)
end)

This script would just make a part stay in front of the player. But if you wanted to make a hat you should use An Accessory and if you're doing that I would recommend this plugin to help you position it: https://web.roblox.com/library/1083168232/Accessory-Grip-Editor

0
Alright thanks for the help. I'm trying to make a custom 3D forcefield when the player spawns. Hwk3rAlt 14 — 5y
Ad

Answer this question