I’m working on a script that will detect if the player owns a specific item and print it.
For some reason, no results are appearing. The script is fired from a local script inside a button in StarterGui, to a server script in ServerScriptService.
Local script:
while true do
wait()
game.ReplicatedStorage.Events.Purchased.Detect:FireServer()
end
Server script:
game.ReplicatedStorage.Events.Purchased.Detect.OnServerEvent:Connect(function(Player)
local Values = Player:WaitForChild("Values")
local Units = Values:WaitForChild("Units")
local RedCat = Units:WaitForChild("RedCat")
local UnitsTable = {
RedCat
}
for a, o in pairs (UnitsTable) do
if o.Value == true then
print(o.Value)
end
end
end)
Any help is appreciated!