You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want a model to stick to an attachment, no rotations. -
What is the issue? Include screenshots / videos if possible!
This happens whenever I try to CFrame it to the attachment.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried making a part that doesn’t rotate at all, but it won’t work, and there was no solutions I saw on here.
Here is the code:
local ServerStorage = game:GetService('ServerStorage')
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, weaponOn)
local character = player.Character
local humanoid = character:WaitForChild('Humanoid')
if not humanoid or not humanoid:IsA('Humanoid') then
return
end
if weaponOn then
local newWeapon = ServerStorage:WaitForChild([['Mericas Weapons]]):Clone()
newWeapon.Parent = character
newWeapon.Name = "murderHouse_2011"
coroutine.wrap(function()
while true do
newWeapon:PivotTo(humanoid.RootPart:WaitForChild('SphericalBall').Attachment.CFrame)
task.wait()
end
end)()
for _, part in newWeapon:GetDescendants() do
if part:IsA('BasePart') then
local newWeld = Instance.new('WeldConstraint', part)
newWeld.Part0 = part
newWeld.Part1 = humanoid.RootPart:WaitForChild('SphericalBall')
end
end
else
local foundWeapon = character:FindFirstChild('murderHouse_2011')
if foundWeapon then
foundWeapon:Destroy()
end
end
end)