so im working on making animations for some wacky tool im making but like
for some reason}
the animations only work for me???
and i don’t mean no like server replication so other people can’t see it
i mean im the only one that can use the animations???
when my friend tries to use the animations nothing happens
yall have any clue why this is happening or could even happen in the first place
i doubt you need code but ill give it anyways
local playersService = game:GetService("Players")
local contextActionService = game:GetService("ContextActionService")
local tweenService = game:GetService("TweenService")
local player = playersService.LocalPlayer
player.CharacterAdded:Wait()
local character = player.Character
local rightArm = character:WaitForChild("Right Arm")
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local tool = script.Parent
workspace.CurrentCamera.CameraSubject = character:WaitForChild("Head")
local regularBodyParts = {
["rightArm"] = character:WaitForChild("Right Arm"),
["leftArm"] = character:WaitForChild("Left Arm"),
["rightLeg"] = character:WaitForChild("Left Leg"),
["leftLeg"] = character:WaitForChild("Right Leg"),
["torso"] = character:WaitForChild("Torso")
}
local modifiedBodyParts = {
["newRightArm"] = regularBodyParts.rightArm:WaitForChild("Right Arm"),
["newLeftArm"] = regularBodyParts.leftArm:WaitForChild("Right Arm"),
["newRightLeg"] = regularBodyParts.rightLeg:WaitForChild("Right Leg"),
["newLeftLeg"] = regularBodyParts.leftLeg:WaitForChild("Right Leg"),
["newTorso"] = regularBodyParts.torso:WaitForChild("Torso")
}
local toolIsEquipped = false
local rightArmColor = rightArm:WaitForChild("Right Arm"):WaitForChild("InnerColor")
local slamTween = tweenService:Create(rightArmColor, TweenInfo.new(1), {Color = Color3.fromRGB(171, 103, 0)})
local slamTween2 = tweenService:Create(rightArmColor, TweenInfo.new(1), {Color = Color3.fromRGB(0, 0, 0)})
local ultTween
local particleAttachmentRightArm = Instance.new("Attachment")
particleAttachmentRightArm.Parent = rightArm
local particleEmitter = script:WaitForChild("Explosion")
particleEmitter.Parent = particleAttachmentRightArm
local animations = {
["Punch"] = script:WaitForChild("Punch"),
["Slam"] = script:WaitForChild("Slam"),
["Ult"] = script:WaitForChild("Punch")
}
local function handleInputs(actionName, inputState, inputObject)
if toolIsEquipped then
if inputState == Enum.UserInputState.Begin then
local animationTrack = animator:LoadAnimation(animations[actionName])
animationTrack:Play()
if actionName == "Slam" then
task.wait(0.3)
slamTween:Play()
task.wait(1)
particleEmitter:Emit(50)
task.wait(0.5)
slamTween2:Play()
end
if actionName == "Ult" then
for _, v in pairs(modifiedBodyParts) do
local innerColor = v.InnerColor
ultTween = tweenService:Create(innerColor, TweenInfo.new(2), {Color = Color3.fromRGB(171, 103, 0)})
ultTween:Play()
end
task.wait(10)
for _, v in pairs(modifiedBodyParts) do
local innerColor = v.InnerColor
ultTween = tweenService:Create(innerColor, TweenInfo.new(2), {Color = Color3.fromRGB(0, 0, 0)})
ultTween:Play()
end
end
end
end
end
tool.Activated:Connect(function()
if toolIsEquipped then
local animationTrack = animator:LoadAnimation(animations.Punch)
animationTrack:Play()
end
end)
tool.Equipped:Connect(function()
toolIsEquipped = true
end)
tool.Unequipped:Connect(function()
toolIsEquipped = false
end)
contextActionService:BindAction("Slam", handleInputs, true, Enum.KeyCode.R)
contextActionService:BindAction("Ult", handleInputs, true, Enum.KeyCode.G)
heres a video of it working for me
heres a video of it not working for my friend
(ignore errors those are from other scripts in the game none of them come from the script)
heck heres the whole model
if you can find any reason why it doesn’t work please tell me