While I was inside of Roblox Studio, I was making a script like the one before you:
local amount = 123
local Module = require(game.ServerScriptService:WaitForChild("Module"))
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.leaderstats.Currency.Value >= amount then
player.leaderstats.Currency.Value = player.leaderstats.Currency.Value - amount
local pet = Module.chooseRandomPet()
--> print(pet.Name.." selected") <--
end
end)
When I went to use it I was greeted with "attempt to concatenate nil with string" around the area with the arrows.
What would I do in order to fix this hindrance.
Module.chooseRandomPet()because whatever it is doing, it isn't returning a pet. - KylaaaNamefield. - Pigletprint((pet.Name or "no pet").." selected")- Egor Skriptunoff