so basically i wanted to make a pet system i tried myself i couldn’t figure out how to make the pet models follow you so i scrapped my entire scripts and i saw alvinblox posted a vid on pet system so i copied that and when i send the pet param it just says nil value so for example if i want the name of the pet so pet.Name it will say ‘attempt to index nil with Name’
the script
local PetModule = require(game.ServerScriptService:WaitForChild("PetModule"))
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr.Stats.Coins.Value >= 100 then
plr.Stats.Coins.Value = plr.Stats.Coins.Value - 100
local pet = PetModule.ChoosePet()
print(pet.Name.." selected")
game.ReplicatedStorage.HatchEgg:FireClient(plr)
end
end)
local script
game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
so for example if i say print(pet.Name) after the function it will say attempt to index nil with Name