When I fire the Event with this
game.ReplicatedStorage.BuyTool:FireServer(212641536)
it works, but it dosent take away the Players cash. It gives me this error... and if i fire it but like this.
game.ReplicatedStorage.BuyTool:FireServer(78730532)
it dosent do anything. Nothing comes in the Output.
local Remote = game:GetService('ReplicatedStorage'):WaitForChild('BuyTool')
local LoadAsset = game:GetService('InsertService')
Remote.OnServerEvent:Connect(function(plr, ID)
if ID == 212641536 then
if plr.leaderstats.Cash.Value >35 then
LoadAsset:LoadAsset(212641536):GetChildren()[1].Parent = plr.Backpack
plr.leaderstats.Cash.Value = plr.leaderstats.Cash -35
elseif
ID == 78730532 then
if plr.leaderstats.Cash.Value >50 then
LoadAsset:LoadAsset(78730532):GetChildren()[1].Parent = plr.Backpack
plr.leaderstats.Cash.Value = plr.leaderstats.Cash -50
end
end
end
end)

1 comment
https://gyazo.com/46fbf5929b25517a66f702600e4410e5