Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a text button UI give a worker a point on click?

Asked by
ghxstlvty 133
4 years ago

For example; A worker is working at the register and they send someone a payment when they click "Send Payment" I want it to give them a point. Or if you could do it so when the customer presses cash or credit it gives the worker a point. Either one is fine.

0
i wanna play your game iuclds 720 — 4y
0
currently it is in Development, but you can join the group to join in the future. https://web.roblox.com/groups/group.aspx?gid=4853203 ghxstlvty 133 — 4y
0
Is this a surface gui or a screen gui? OswinFalls 69 — 4y
0
It's a screen GUI. ghxstlvty 133 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Assuming this is for a surface gui, you will first need to put the SurfaceGui under the StarterGuis. Unfortunately, LUA can't figure out who is clicking a surfacegui textbutton otherwise.

To have it still appear on the object though, click the property "Adornee" under the surface gui and then click the part you want it to appear on.

For scripting you will need to create three things: a script in serverscriptstorage, a local script under your text button, and a remote event.

your local script should listen for the event of the button being clicked and fire the remote event. The script should listen to the remote event being fired and add a point to the player.

Here's some more info on remote events: https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

Hope this helps!

Ad

Answer this question