Hello, I’m currently making an equipping function and I’ve ran into a problem, in the code below I’m creating a part that goes on the right hand of the player, and a weld that checks for my axe model during an animation. Below is also screenshots of server vs client side.
It’s my first time doing something like this so I’m probably doing things as wrong as I can possibly do them, but all I know is that the problem has something to do with the if statement as the part rotates anywhere outside the statement. Any help will be appreciated!
Normally this would happen when Roblox isn’t replicating something to the client because it’s saving memory in some way. I kinda forgot. Sorry for not explaining it well.
Server vs Client: If the part creation and weld adjustments are being done on the client, make sure that the server is aware of these changes. Server-side scripts are authoritative in Roblox, meaning any changes made on the client can be overridden unless properly replicated.
Weld Behavior: Adjusting a part’s CFrame or Position directly when it is welded might lead to unexpected results because the weld will override these properties. Instead, you should adjust the C0 and C1 properties of the weld.
Collision Detection: workspace:GetPartsInPart(handPart) might not always return consistent results, especially if handPart is small or if physics are acting on it rapidly.
runService.Heartbeat:Connect(function()
local handPartHitbox = workspace:GetPartsInPart(handPart)
for _, instance in pairs(handPartHitbox) do
if instance.Name == “playerAxeLocation” then
print(“HAAAANDDD”)
handWeld.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(180), math.rad(40))
– No need to set weld2.Part0 here
end
end
end)