Advertisement
Osyrisa

SCRIPTS!

Mar 8th, 2021
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. ----Script leaderstats---
  2.  
  3. game.Players.PlayerAdded:Connect(function(player)
  4. local stats = Instance.new("Folder")
  5. stats.Name = "leaderstats"
  6. stats.Parent = player
  7.  
  8. local strength = Instance.new("IntValue")
  9. strength.Name = "Strength"
  10. strength.Value = 0
  11. strength.Parent = stats
  12.  
  13. local cash = Instance.new("IntValue")
  14. cash.Name = "Cash"
  15. cash.Value = 0
  16. cash.Parent = stats
  17. end)
  18.  
  19.  
  20.  
  21. ----MainEvent script----
  22.  
  23.  
  24.  
  25. script.AddStrength.OnServerEvent:Connect(function(player)
  26. player.leaderstats.Strength.Value = player.leaderstats.Strength.Value +1
  27. end)
  28.  
  29.  
  30.  
  31.  
  32.  
  33. ---Weight/Tool Script---
  34.  
  35. script.Parent.Activated:Connect(function()
  36. game.Workspace.MainEvent.AddStrength:FireServer()
  37. script.Parent.Enabled = false
  38. wait(0.4)
  39. script.Parent.Enabled = true
  40. end)
  41.  
  42.  
  43.  
  44. ---sellpart script---
  45.  
  46. local part = script.Parent
  47. part.Touched:Connect(function(hit)
  48. local h = hit.Parent:FindFirstChild("Humanoid")
  49. if h then
  50. local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  51. if player then
  52. local leaderstats = player:WaitForChild("leaderstats")
  53. local money = leaderstats.Cash
  54. local selling = leaderstats.Strength
  55. if selling.Value >=0 then
  56. money.Value = money.Value + selling.Value*1
  57. selling.Value = 0
  58. end
  59. end
  60. end
  61. end)
  62.  
  63.  
  64. ---Please watch https://www.youtube.com/watch?v=bGE0fAybuYE&t=32s If your confused--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement