- What do you want to achieve?
I want to achieve a code that clones a model in RepStorage (which is a shoe) and make it weld to the foot and make it move with it, like a shoe in Bee Swarm Simulator. I have a weld script but it isn’t working out too well.
- What is the issue?
When I do it, it works, however, the shoe goes in the middle of my leg when I want it on the foot.
Here is my code.
local function GiveCleat(player)
repeat wait() until player.Character
local Cleat = game.ReplicatedStorage["Salient Aquamarine"]:Clone()
local Character = player.Character
local Attachment = Character:FindFirstChild("RightFootAttachment", true)
local ParentOf = Attachment.Parent
Cleat.Parent = ParentOf
Cleat.shoes.CFrame = Attachment.CFrame
local weld = Instance.new("Weld")
weld.Name = "ShoeWeld"
weld.Part0 = Cleat.shoes
weld.Part1 = ParentOf
--weld.C0 = ParentOf.CFrame:Inverse()
--weld.C1 = Cleat.shoes.CFrame:Inverse()
weld.Parent = Cleat.shoes
end
game.Players.PlayerAdded:Connect(function(player)
GiveCleat(player)
end)
-
What solutions have you tried so far?
I have ried using C0 and C1, but when I do, it’d always put my cleat like 10 miles in the sky, like the position my leg was at when my character was loading, I think. Not too sure.
I’ve been dodging learning welds so when I need to use them it bites me back real hard. Help will be appreciated against this! Been pulling on my hair.