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

Why is the belt not being welded to the player?

The belt just spawns in and gets flicked away, i'm guessing it flicks like that because it was inside of another touchable part and not welded to it.

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LobbyBelt = ReplicatedStorage.LobbyBelt

Players.PlayerAdded:Connect(function(Player)
    local Character = Player.Character or Player.CharacterAdded:wait()
    local Belt = LobbyBelt:Clone()
    Belt.Parent = Character
    Belt.CFrame = Character.LowerTorso.CFrame
    local Weld = Instance.new("ManualWeld")
    Weld.Parent = Belt
    Weld.Part0 = Belt
    Weld.Part1 = Character.LowerTorso
    Weld.C0 = CFrame.new(0, 0, 0)
    print("Player Equipped the Lobby Belt")
end)

2 answers

✓ Accepted answer
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LobbyBelt = ReplicatedStorage.LobbyBelt

Players.PlayerAdded:Connect(function(Player)
    local Character = Player.Character or Player.CharacterAdded:wait()
    local Belt = LobbyBelt:Clone()
    Belt.Parent = Character
    Belt.CFrame = CFrame.new(Character.LowerTorso.Position)--changes the position of the belt to the players lower torso
    local Weld = Instance.new("Weld")--makes a working weld, sticks to the player
    Weld.Parent = Belt
    Weld.Part0 = Belt
    Weld.Part1 = Character.LowerTorso
    print("Player Equipped the Lobby Belt")
end)

u dont need the co part of the weld and the rest of the script is urs for any moderator out there, dont downvote me ps. if this works as i belive it will cause i tested it out to be sure then pls upvote

4 comments

0

also u need to update the Belt.CFrame constantly otherwise it wont follow the player

0

Great now the belt just falls straight through the floor.

0

The flinging away isn't the issue, the flinging away is just a result. A result of the Belt somehow not getting welded. And like my question asks I'm looking for a way to fix the weld.

0

CFrame is used to change the position of something, it doesnt hold any numbers but it needs numbers to put whatever u wanna change the location of to that location

I solved it by instead of using

Character.LowerTorso

I used

game.Workspace:WaitForChild(Player.Name):WaitForChild("LowerTorso")

Cause finding the Character like this is always an alternative for me with confusing issues like this.

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