Trying to get player from textbutton on surface UI ran server side.
Clicking the button works, no matter how I try and pull local player, it either returns some arbitrary number or nil. I've gone as far as trying to use Players as a service, returning the same depending on how I address it.
local clickDetector = script.Parent
print(players.LocalPlayer)
local function ButtonPressed(player)
print(player)
end
clickDetector.MouseButton1Down:Connect(ButtonPressed)```