So I need this button to check the player's leader stats before it teleports them to the map but it says "attempt to index nil with parent" pls help
local tp = script.Parent
local TeleportService = game:GetService("TeleportService")
tp.MouseButton1Click:Connect(function(click)
if game:GetService("Players")(click.Parent.Name).leaderstats.Exp >= 30000 then
print("yay")
local lobby = 4975824844
TeleportService:Teleport(lobby)
end
end)

3 comments
where is this script located? Is it local script or server script?
local script and its the child of the button
Try adding '.Value' after 'leaderstats.Exp'.