attempt to perform arithmetic (mul) on number and Instance?
I am trying to multiply coins using string values that are attached to the player, one of the string values attached to is Pickaxe, this is the pickaxe that is saved when they join the game, inside the pickaxe is a multiplier value which will multiply the coins, here I tryed getting the Item in the ReplicatedStorage by using the value attached to the player, but it didn't work and the title is the error
01 | local shopkeeper = game.Workspace:FindFirstChild( "Sell your ore here!" ) |
02 | local guiNoticeEvent = game.ReplicatedStorage:WaitForChild( "GUINoticeEvent" ) |
03 | RepStor = game:GetService( "ReplicatedStorage" ) |
05 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
06 | if (humanoid and humanoid ~ = shopkeeper) then |
07 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
08 | if (player.InventoryValue.Value > 0 ) then |
09 | local savedValue = player.InventoryValue.Value |
10 | player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.InventoryValue.Value * RepStor [ player.Pickaxe.Value ] |
11 | player.InventoryValue.Value = 0 |
12 | player.InventoryCount.Value = 0 |
13 | guiNoticeEvent:FireClient(player, 0 , savedValue) |
17 | script.Parent.Touched:Connect(onTouch) |