Getting a value from a module script with a stringValue

  1. What do you want to achieve? Keep it simple and clear!

When a remoteEvent is called with a stringValue of a name i dont know how to get the price using the string

  1. What is the issue?

I dont know how to search the module with the stringValue

  1. What solutions have you tried so far?

I searched everywhere, nothing helped

CODE

local Manager = require(script.ShopItems)

local repStorage = game:GetService("ReplicatedStorage")
local Buy = repStorage:FindFirstChild("Buy")

Buy.OnServerEvent:Connect(function(player,item)
	
	local leadearstats = player:FindFirstChild("leaderstats")
	local Score = leadearstats:FindFirstChild("Score")
	
	
	if Score.Value >= Manager.item.Price then
		
	end
	
end)

1 Like

Try doing Manager[item].Price. You are currently searching for a key named “item” inside manager, not the actual item as a key.

2 Likes

Ah, thank you very much! it worked as intended

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.