I have no idea what's happening, can someone help? hear is my code:
game.Players.PlayerAdded(function(player) player.CharacterAppearanceLoaded:Connect(function(char) local h = game:GetService("ServerStorage"):FindFirstChild("KatanaModel"):Clone() if not char:IsA("Model") then return end local rHand = char:FindFirstChild("RightHand") h:SetPrimaryPartCFrame(rHand.CFrame * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))) local weld = Instance.new("Weld") weld.Part0 = rHand weld.Part1 = char weld.Name "HandleWeld" weld.Parent = rHand h.Parent = char end) end)
You missed a connect on PlayerAdded. I also edited the code to utilise appearance loaded correctly, but you can change back if you want.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded(function(char) player.CharacterAppearanceLoaded:Wait() wait(0.1) -- do stuff end) end)
so would it be:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded(function(char) player.CharacterAppearanceLoaded:Wait() wait(0.1) local h = game:GetService("ServerStorage"):FindFirstChild("KatanaModel"):Clone() if not char:IsA("Model") then return end local rHand = char:FindFirstChild("RightHand") h:SetPrimaryPartCFrame(rHand.CFrame * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))) local weld = Instance.new("Weld") weld.Part0 = rHand weld.Part1 = char weld.Name "HandleWeld" weld.Parent = rHand h.Parent = char end) end)