-
What do you want to achieve?
I would like the sword to be rotated properly, and for the solution to work for all weapons. -
What is the issue?
The sword juts out to the right of the character, and needs to be rotate 90 degrees to the left.
-
What solutions have you tried so far?
- weld.C1 (problem with this is that i want this to work for all weapons, some rotate fine)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = ReplicatedStorage:WaitForChild("Remotes")
local inputEvent = remotes:WaitForChild("InputEvent")
local modules = ReplicatedStorage:WaitForChild("Modules")
local valuesModule = require(modules:WaitForChild("Values"))
local models = ReplicatedStorage:WaitForChild("Models")
inputEvent.OnServerEvent:Connect(function(player, args)
local blockInput = valuesModule.findValue(player, "blockInput")
local attackInput = valuesModule.findValue(player, "attackInput")
local equipInput = valuesModule.findValue(player, "equipInput")
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local rightArm = character:FindFirstChild("Right Arm")
if valuesModule.findValue(player, "equipped") then
if args.input == blockInput then
print("block")
elseif args.input == attackInput then
print("attack")
elseif args.input == equipInput then
valuesModule.changeValue(player, "equipped", false)
end
else
if args.input == equipInput then
valuesModule.changeValue(player, "equipped", true)
local weaponName = valuesModule.findValue(player, "weapon")
local weapon = models:FindFirstChild(weaponName)
local weaponClone = weapon:Clone()
local primaryPart = weaponClone.PrimaryPart
weaponClone.Parent = rightArm
local weld = Instance.new("Motor6D", rightArm)
weld.Part0 = rightArm
weld.Part1 = primaryPart
end
end
end)
