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
local shopkeeper = game.Workspace:FindFirstChild("Sell your ore here!")
local guiNoticeEvent = game.ReplicatedStorage:WaitForChild("GUINoticeEvent")
RepStor = game:GetService("ReplicatedStorage")
function onTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if (humanoid and humanoid ~= shopkeeper) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if (player.InventoryValue.Value > 0) then
local savedValue = player.InventoryValue.Value
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.InventoryValue.Value * RepStor[player.Pickaxe.Value]
player.InventoryValue.Value = 0
player.InventoryCount.Value = 0
guiNoticeEvent:FireClient(player, 0, savedValue)
end
end
end
script.Parent.Touched:Connect(onTouch)

3 comments
Thank you so much!
Also I corrected the error but it wont multiply, it now says RepStor[player.Pickaxe.Value].multiplier.Value
what error are you getting