(?)script not working in game thats suppos to add but works in studio and gives no error ...---...
I use remote events to connect the scripts
script:
1 | local RemoteEvent = Instance.new( 'RemoteEvent' ) |
2 | RemoteEvent.Parent = game.ReplicatedStorage |
3 | RemoteEvent.Name = "Increase CB" |
5 | function Increase(player) |
6 | player.leaderstats [ 'Crate Bux' ] .Value = player.leaderstats [ 'Crate Bux' ] .Value + player.PlayerGui.MainGui.Buttons [ 'CLICK for CRATE BUX' ] .amount.Value |
8 | RemoteEvent.OnServerEvent:Connect(Increase) |
localscript :
1 | local Remote = game.ReplicatedStorage:FindFirstChild( 'Increase CB' ) |
2 | local player = game.Players.LocalPlayer |
3 | local Gui = player.PlayerGui |
4 | local amount = player.PlayerGui.MainGui.Buttons [ 'CLICK for CRATE BUX' ] .amount |
5 | local CrateBux = player.leaderstats [ 'Crate Bux' ] |
7 | Gui.MainGui.Buttons [ 'CLICK for CRATE BUX' ] .MouseButton 1 Click:Connect( function () |