I made a remote event to fire an event to add to a number value but it doesnt add
code to add to the number value
game.ReplicatedStorage.Assets.Events.EquipPet.OnServerEvent:Connect(function(player, petamount)
print(petamount)
player.StatMulti.coinsMulti.Value = player.StatMulti.coinsMulti.Value + petamount
print(player.StatMulti.coinsMulti.Value)
end)
NOTE : the default value is 0 and its adding 50
1 Like
Qu1rkify
(Qurki)
November 24, 2020, 9:31pm
#2
Is there anything in the output?
sthaple
(stha)
November 24, 2020, 9:53pm
#3
Does the output contain any errors and does it actually print these values out? Please don’t forget to provide the output if possible as it’s much easier to spot and fix issues with it.
it prints everything correctly: the petamount 50 and the value of the numvalue 0
can you show the firing script?
its in a .mousebutton1down event
if amountEquipped < 5 and petModel.Equipped.Value == false and not game.Players.LocalPlayer.EquippedPets:FindFirstChild(petStringv) then
amountEquipped += 1
local clone = petModel:Clone()
petModel.Equipped.Value = true
clone.Parent = game.Players.LocalPlayer.Character.EquippedPets
setupPet(clone)
local newPet = Instance.new("StringValue", game.Players.LocalPlayer.EquippedPets)
newPet.Name = petName
newPet.Value = game.Players.LocalPlayer.PlayerGui.GameGui.Inventory.PetInfo.PetView[clone.Name].Value
game.Players.LocalPlayer.PlayerGui.GameGui.Inventory.PetInfo.Equip.Text = "Unequip"
game.ReplicatedStorage.Assets.Events.EquipPet:FireServer(petModel.Coins.Value)
end