Hello,
I am currently working on a script that rotates the player’s accessory by 90 degrees whenever they press a button. Everything works well, however, the accessory doesn’t rotate. I have tracked down the problem to the way I am rotating it, however, I am unsure how to get it to rotate properly. Here is my server script:
game.ReplicatedStorage.CustomizationEvents.ChangeWeld.OnServerEvent:Connect(function(player, AcessoryName, thingy, rot)
print(player)
print(AcessoryName)
local children = player.Character:GetChildren()
for i, child in ipairs(children) do
if child:IsA("Accessory") then
if child.Name == AcessoryName then
local weld = child.Handle:FindFirstChildWhichIsA("Weld")
if rot == 'x' then
child.Handle.Rotation += Vector3.new(0, 90, 0) -- issue, doesn't rotate but unsure how to rotate it properly.
print(child.Handle.Rotation)
end
end
end
end
end)
Any help would be appreciated!