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 to be able to weld a tool to the character while sprinting and it not stop the character. it does not stop me when im not running.
Here is the weld script in server:
Character.ChildAdded:Connect(function(Item)
if Item:IsA("Tool") and Item:FindFirstChild("Weapon") then
if HoldingOutWeapon then
return
end
HoldingOutWeapon = true
local Weapon = ServerStorage.Weapons:FindFirstChild(Item.Name)
if not Weapon then
return
end
Weapon = Weapon:Clone()
Weapon.Parent = Character
Weapon.Weld.Part0 = Character.Hilt
Weapon.Weld.Part1 = Weapon
EquippedWeapon = Weapon
end
end)
Here is sprint script in client:
local function doSprint()
if not sprinting then
if canSprint() then
sprinting = true
cdBeforeSprintAgain = true
hum.WalkSpeed = 25
--Add weapon sprint anims later
normalsprint:Play()
end
elseif sprinting then
sprinting = false
hum.WalkSpeed = 16
normalsprint:Stop()
task.wait(.5)
cdBeforeSprintAgain = false
end
end
local function InputBegan(input, typing)
if typing then return end
--Run
if input.KeyCode == Enum.KeyCode.LeftShift and not cdBeforeSprintAgain then
if swimming then return end
doSprint()
end
--