Need help with gui

Hi Scripters! I’m in need for your help!
I want to change leaderstats and save in datastore.
I’m trying to detect button pressed with regular script. how i need to do that?

This might help! https://www.youtube.com/watch?v=DkYupSBUpes
https://www.youtube.com/watch?v=4x2OvsA6Tic&ab_channel=GamerM8

1 Like

Can’t help. There aren’t any buttons there lol

What do you mean? Click the link.

1 Like

I wan’t to detect when player press button with regular script. It’s datastore tutorial man

1 Like

Can please use google translate? I don’t understand you very well.

Use this function: button.MouseButton1Click:Connect(function() end)

Will it work in regular scripts

You need to use localscripts, .

That is not true. The MouseButton1Click function works on both scripts.

1 Like

“MouseButton1Click” does work on the server (however it’s not encouraged to do so). Keep your Guis client-sided and you really shouldn’t be using a regular script for that.


image

They work, but that doesn’t necessarily mean they should be used instead. Local scripts should be used instead, as the server doesn’t have complete knowledge of the client. That aside, regular scripts shouldn’t be used as Guis are client-sided. You should use a remote event to communicate with the server.