The problem here is that every time I run this script and open a tool from inventory it doesn't show the tool to any other clients or the server, Also the script is located in StarterCharacterScripts
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local chr = plr.Character
local hum = chr:WaitForChild("Humanoid")
local leaderstats = plr.leaderstats
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://5747311876"
local animationTrack = hum:LoadAnimation(animation)
local cooldown = 2
local ready = true
local RS = game:GetService("ReplicatedStorage")
local AddStrength = RS:WaitForChild("AddStrength")
local tool = game.ReplicatedStorage["Strength+1"]:Clone()
tool.Parent = plr.Backpack
tool.Activated:Connect(function()
if ready == true then
animationTrack:Play()
animationTrack.Looped = true
ready = false
wait(cooldown)
animationTrack.Looped = false
AddStrength:FireServer(leaderstats)
ready = true
end
end)

1 comment
Thank You!