Why is my gui button not working to fire the remote event?
I made a gui that lets you buy a sword but when you click the button it wont fire the event to purchase the sword and there are no errors can you pls help me?
LOCAL SCRIPT(THIS IS IN THE PLAYERS GUI)
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | local player = game.Players.LocalPlayer |
4 | script.Parent.goodjob:FireServer(player) |
SERVER SCRIPT(THIS IS IN THE PLAYERS GUI ALSO AND SO IS THE REMOTE EVENT)
01 | script.Parent.goodjob.OnServerEvent:Connect( function (player) |
02 | local sword = game.Lighting.DualRage |
03 | local diamonds = player.diamonds.diamonds.Value |
04 | if diamonds > = 300 then |
05 | diamonds = diamonds - 300 |
06 | local prize = sword:Clone() |
07 | prize.Parent = player.StarterGear |
08 | local prize 2 = sword:Clone() |
09 | prize 2. Parent = player.Backpack |