Advertisement
gmljgiihjklhjlkjmhkm

1 simulator script

Nov 9th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. LOCAL SCRIPT IN PLAYERUI SCREEN GUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  2. local Player = game.Players.LocalPlayer
  3.  
  4. local BagText = script.Parent.BagLabel
  5.  
  6. local CoinText = script.Parent.CoinLabel
  7.  
  8. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  9. local RemoteEvents = ReplicatedStorage.RemoteEvents
  10.  
  11. BagText.Text = "Bag: " .. Player.PlayerStats.CurrentValue.Value .. "/" .. Player.PlayerStats.Storage.Value
  12. CoinText.Text = "Coins: " .. Player.PlayerStats.Coins.Value
  13.  
  14. Player.PlayerStats.CurrentValue:GetPropertyChangedSignal("Value"):Connect(function()
  15. BagText.Text = "Bag: " .. Player.PlayerStats.CurrentValue.Value .. "/" .. Player.PlayerStats.Storage.Value
  16. end)
  17.  
  18.  
  19. Player.PlayerStats.Coins:GetPropertyChangedSignal("Value"):Connect(function()
  20. CoinText.Text = "Coins: " .. Player.PlayerStats.Coins.Value
  21. end)
  22.  
  23. REGULAR SCRIPT IN SERVERSCRIPTSERVICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  24. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  25. local RemoteEvents = ReplicatedStorage.RemoteEvents
  26. local CoinClicked = RemoteEvents.CoinClicked
  27.  
  28. CoinClicked.OnServerEvent:Connect(function(player, Strength)
  29. if player.PlayerStats.CurrentValue.Value < player.PlayerStats.Storage.Value then
  30. player:WaitForChild("PlayerStats").CurrentValue.Value = player.PlayerStats.CurrentValue.Value + Strength
  31. end
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement