#About to lose my mind

1 messages · Page 1 of 1 (latest)

turbid sparrow
#

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)```
#

I've also tried publishing the game

terse bane
#

Server for mouse button press?

#

I'd assume you wanna find the player so you'd probs have to go up parent by parent until the ancestor is a player

turbid sparrow
#

Trying to work in steps, had a script working with a proximity prompt, and wanted to get it working with a surfaceUI and expected the same behavior, and about the same way to get the player

#

All this before I figure out how to display different text per player

#

Still learning client side stuff

wheat crest
#

don't you have to get the player on the client

#

@turbid sparrow

turbid sparrow
#

Shouldn't there be a way on server side to detect who clicked on something?

narrow whale
turbid sparrow
wispy inlet
turbid sparrow
#

I'll have to look into that, again still new to client side stuff, so I'll have to see what the characteristics of that property changes. Already looking at starting from scratch to rework some things

#

I really appreciate the advice!

turbid sparrow
#

Guess I'm dating myself when I talk about old methods :C