I think it has something to do with the remote event.
The server event script for the tool:
local liftSwordEvent = game.ReplicatedStorage.RemoteEvents:WaitForChild("LiftSword")
liftSwordEvent.OnServerEvent:Connect(function(player,cashIncreaseValue)
local cash = game.Players[script.Parent.Parent.Name].leaderstats.Cash
for i, toolsInCharacter in pairs(script.Parent.Parent:GetChildren()) do
if toolsInCharacter and toolsInCharacter:IsA("Tool") then
local cashIncrease = toolsInCharacter:WaitForChild("CashIncrease")
local multiplier = toolsInCharacter:WaitForChild("CashMultiplier")
if multiplier then
cash.Value = cash.Value + cashIncrease.Value * multiplier.Value
end
end
end
end)
The local script for the tool:
local sword = script.Parent
local liftSwordEvent = game.ReplicatedStorage.RemoteEvents:WaitForChild("LiftSword")
sword.Activated:Connect(function()
if sword.Parent == game.Players.LocalPlayer.Character then
liftSwordEvent:FireServer()
end
end)
The leaderstats script
game.Players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "leaderstats"
local cash = Instance.new("IntValue",folder)
cash.Name = "Cash"
cash.Value = 1500
local weaponsOwned = Instance.new("Folder",player)
weaponsOwned.Name = "weaponsowned"
local sword1owned = Instance.new("BoolValue",weaponsOwned)
sword1owned.Name = "Sword1owned"
sword1owned.Value = false
local sword2owned = Instance.new("BoolValue",weaponsOwned)
sword2owned.Name = "Sword2owned"
sword2owned.Value = false
end)
Thanks!

1 comment
Then my answer is still valid since characters cannot equip more than 1 tool at the same time