Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----Script leaderstats---
- game.Players.PlayerAdded:Connect(function(player)
- local stats = Instance.new("Folder")
- stats.Name = "leaderstats"
- stats.Parent = player
- local strength = Instance.new("IntValue")
- strength.Name = "Strength"
- strength.Value = 0
- strength.Parent = stats
- local cash = Instance.new("IntValue")
- cash.Name = "Cash"
- cash.Value = 0
- cash.Parent = stats
- end)
- ----MainEvent script----
- script.AddStrength.OnServerEvent:Connect(function(player)
- player.leaderstats.Strength.Value = player.leaderstats.Strength.Value +1
- end)
- ---Weight/Tool Script---
- script.Parent.Activated:Connect(function()
- game.Workspace.MainEvent.AddStrength:FireServer()
- script.Parent.Enabled = false
- wait(0.4)
- script.Parent.Enabled = true
- end)
- ---sellpart script---
- local part = script.Parent
- part.Touched:Connect(function(hit)
- local h = hit.Parent:FindFirstChild("Humanoid")
- if h then
- local player = game.Players:GetPlayerFromCharacter(hit.Parent)
- if player then
- local leaderstats = player:WaitForChild("leaderstats")
- local money = leaderstats.Cash
- local selling = leaderstats.Strength
- if selling.Value >=0 then
- money.Value = money.Value + selling.Value*1
- selling.Value = 0
- end
- end
- end
- end)
- ---Please watch https://www.youtube.com/watch?v=bGE0fAybuYE&t=32s If your confused--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement