warycoolio
(warycoolio)
October 18, 2020, 11:23pm
#1
You can write your topic however you want, but you need to answer these questions:
A friend of mine made sword animations for me, and I set Require Handle to false so I can weld the sword to the right arm.
The sword goes poof. Literally… https://gyazo.com/a417ec84fe0466eb5cfd599f34b162d7
I have been looking around for some weld scripts but I used my own.
local animation = script:WaitForChild("Animations")
local idle = animation:WaitForChild("Idle")
local run = animation:WaitForChild("Run")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local Humanoid = char:WaitForChild("Humanoid")
local track = char.Humanoid:LoadAnimation(idle)
track.Looped = true
local weld
script.Parent.Equipped:Connect(function()
weld = Instance.new("Weld",char["Right Arm"])
weld.Part0 = char["Right Arm"]
weld.Part1 = script.Parent.Sword
track:Play()
end)
script.Parent.Unequipped:Connect(function()
weld:Destroy()
track:Stop()
end)
game.ReplicatedStorage.Remotes.Jam.OnClientEvent:Connect(function()
game.Workspace.Folder.Courage:Play()
end)
CiAxe
(CiAxe)
October 18, 2020, 11:37pm
#2
The reason the sword disappears is because you deleted the swords weld to the players right hand. At least that is what it looks like. (Though, I am pretty sure you did not unequip the sword in the gif)
warycoolio
(warycoolio)
October 18, 2020, 11:40pm
#3
I did not de equip the sword. It literally deleted the sword from my backpack and made me unequip it.
CiAxe
(CiAxe)
October 18, 2020, 11:42pm
#4
Are you using a tool for the sword?
warycoolio
(warycoolio)
October 18, 2020, 11:43pm
#5
Yeah, I probably should of used a full gif next time
CiAxe
(CiAxe)
October 18, 2020, 11:45pm
#6
If you are using a tool, you do not have to weld the sword to the players right hand, since the Tool
will do that for you.
warycoolio
(warycoolio)
October 18, 2020, 11:46pm
#7
It’s so the idle animation can move the sword. With handle on, it would make one hand just not work
CiAxe
(CiAxe)
October 18, 2020, 11:48pm
#8
Then I would suggest not using a tool at all, and just use a script to weld the sword to the player’s character when the player “Equips” the sword.
warycoolio
(warycoolio)
October 18, 2020, 11:51pm
#9
The sword system I use works with tools I believe, are there any alternatives?
CiAxe
(CiAxe)
October 18, 2020, 11:54pm
#10
The only alternative I have used if when the player joins the game I just weld the sword to the player’s righthand. Then I would have a LocalScript
that handles the sword it’s self, (when the player swings, Mouse.Button1Down
I would play the animation that way).
1 Like
warycoolio
(warycoolio)
October 18, 2020, 11:56pm
#11
So a onCharacterAdded function that would weld the sword to the character’s right hand?
local animation = script:WaitForChild("Animations")
local idle = animation:WaitForChild("Idle")
local run = animation:WaitForChild("Run")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local Humanoid = char:WaitForChild("Humanoid")
local track = char.Humanoid:LoadAnimation(idle)
track.Looped = true
local weld
game.Players.LocalPlayer.CharacterAdded:Connect(function()
weld = Instance.new("Weld",char["Right Arm"])
weld.Part0 = char["Right Arm"]
weld.Part1 = script.Parent.Sword
end)
script.Parent.Equipped:Connect(function()
track:Play()
end)
script.Parent.Unequipped:Connect(function()
track:Stop()
end)
game.ReplicatedStorage.Remotes.Jam.OnClientEvent:Connect(function()
game.Workspace.Folder.Courage:Play()
end)
Here’s what I got, same problem. This time, the sword doesn’t even appear.
CiAxe
(CiAxe)
October 19, 2020, 12:21am
#12
Do this in a Normal script on the server:
--Variables Here
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
--Code Here
end)
end)
warycoolio
(warycoolio)
October 19, 2020, 12:25am
#13
warycoolio:
end)
Same problem. I believe I should handle the idle animation on such on the localscript, so I left that there.
local weld
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
weld = Instance.new("Weld",char["Right Arm"])
weld.Part0 = char["Right Arm"]
weld.Part1 = game.StarterPack.Sword.Sword
end)
end)
warycoolio
(warycoolio)
October 19, 2020, 1:12am
#14
Or, should I put the entire script in the serverscript?
When you equip a tool a RightGrip weld is added to your right hand that attaches it to your hand:
If you want it to weld the tool to your arm you can just modify the Part0 property.
1 Like
warycoolio
(warycoolio)
October 19, 2020, 1:23am
#16
Should I use a Motor6D instead, then? Because it was animated with a Motor6D
EDIT: I used a motor6d, and legit. same outcome.
warycoolio
(warycoolio)
October 19, 2020, 1:46am
#17
Do I have to attach the sword to the arm, or something?
warycoolio
(warycoolio)
October 19, 2020, 2:27am
#18
Oh wait, the handle just gets fixed after swinging the sword once…
EDIT: nevermind, this happens when the handle is on
one hand is holding it up, (the right arm) and the other arm is doing the idle animation
warycoolio
(warycoolio)
October 19, 2020, 2:23pm
#19
found a solution for this hand holding up, here’s the script
local NOHANDOUT_ID = 04484494845
local function DisableHandOut(character)
local Animator = character.Animate
local Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/asset/?id="..NOHANDOUT_ID
local ToolNone = Animator:FindFirstChild("toolnone")
if ToolNone then
local NewTool = Instance.new("StringValue")
NewTool.Name = "toolnone"
Animation.Name = "ToolNoneAnim"
Animation.Parent = NewTool
ToolNone:Destroy()
NewTool.Parent = Animator
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
DisableHandOut(character)
end)
end)
put this in serverscriptservice