Error : Mouse1Click is not a valid member of ServerScriptService
01 | local repStorage = game:GetService( "ReplicatedStorage" ) |
02 | local remote = repStorage:FindFirstChild( "ButtonClick" ) |
03 |
04 | local button = script.Parent |
05 |
06 | local debounce = false |
07 |
08 | button.Mouse 1 Click:Connect( function () |
09 | if not debounce then |
10 | debounce = true |
11 | local playerPoint = game.Players.LocalPlayer.leaderstats.Points |
12 | remote:FireServer(playerPoint) |
13 | wait( 0.01 ) |
14 | debounce = false |
15 | end |
16 | end ) |
https://imgur.com/a/uEVsPaA
Your script is fine (i rearranged some things so its a bit more organized)
01 | local repStorage = game:GetService( "ReplicatedStorage" ) |
02 | local remote = repStorage:FindFirstChild( "ButtonClick" ) |
03 | local player = game.Players.LocalPlayer |
04 |
05 | local button = script.Parent |
06 |
07 | local debounce = false |
08 |
09 | button.Activated:Connect( function () |
10 | if debounce = = true then return end |
11 | debounce = true |
12 | local playerPoint = player.leaderstats.Points |
13 | remote:FireServer(playerPoint) |
14 | wait( 0.01 ) |
15 | debounce = false |
16 | end ) |
When you write
1 | local button = script.Parent |
make sure this refers to a TextButton or Image Button in a GUI under StarterGui
It seems as if you have used, "Mouse1Click" which isn't a valid property of the mouse.
01 | local repStorage = game:GetService( "ReplicatedStorage" ) |
02 | local remote = repStorage:FindFirstChild( "ButtonClick" ) |
03 |
04 | local button = script.Parent |
05 |
06 | local debounce = false |
07 |
08 | button.MouseButton 1 Down:Connect( function () |
09 | if not debounce then |
10 | debounce = true |
11 | local playerPoint = game.Players.LocalPlayer.leaderstats.Points |
12 | remote:FireServer(playerPoint) |
13 | wait( 0.01 ) |
14 | debounce = false |
15 | end |
16 | end ) |