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 my tools that use motor6d animations to start in the players hand
- What is the issue? Include screenshots / videos if possible!
when using a package smaller than the default (such as the woman package) the tool is offset because the arms are smaller
Localscript inside of tool
local tool = script.Parent
local player = game.Players.LocalPlayer --getplayer
local char = player.Character or player.CharacterAdded:Wait() --get character
local animIdle = script.Parent.BodyAttach.AnimIdle
local animEquip = script.Parent.BodyAttach.AnimEquip
local animUse = script.Parent.BodyAttach.AnimUse
local track
local trackequip
local debounce
tool.Activated:Connect(function()
if debounce == false then
debounce = true
trackuse = script.Parent.Parent.Humanoid:LoadAnimation(animUse)
trackuse.Priority = Enum.AnimationPriority.Action4
trackuse.Looped = false
trackuse:AdjustSpeed(1)
trackuse:Play()
task.wait(0.5)
script.Parent.Cane.Lick:Play()
task.wait(1.5)
if trackuse then
trackuse:Stop()
end
debounce = false
end
end)
tool.Equipped:Connect(function()
game.ReplicatedStorage.ConnectM6D:FireServer(tool.BodyAttach)
char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
char.UpperTorso.ToolGrip.Part1 = tool.BodyAttach
debounce = true
if player.Character:FindFirstChild("Candy Cane") ~= nil then
track = script.Parent.Parent.Humanoid:LoadAnimation(animEquip)
track.Priority = Enum.AnimationPriority.Action4
track.Looped = false
track:AdjustSpeed(2)
track:Play()
task.wait(0.3)
track = script.Parent.Parent.Humanoid:LoadAnimation(animIdle)
track.Priority = Enum.AnimationPriority.Action2
track.Looped = true
track:Play()
debounce = false
end
end)
tool.Unequipped:Connect(function()
track:Stop()
game.ReplicatedStorage.DisconnectM6D:FireServer()
end)
serverscript for M6Ds
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(char)
local M6D = Instance.new("Motor6D")
M6D.Name = "ToolGrip"
M6D.Parent = char:WaitForChild("UpperTorso")
end)
end)
game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr, location)
local char = plr.Character
char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
char.UpperTorso.ToolGrip.Part1 = location
end)
game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
plr.Character.UpperTorso.ToolGrip.Part1 = nil
end)