Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService('Players')
- local ServerStorage = game:GetService('ServerStorage')
- local Loot = {'Shield', 'medi-bomb', 'bomb', 'battle ax', 'battle hamma', 'healing bow', 'Explode', 'bow'}
- local Positions = {
- Vector3.new(-42, 8, -44.5), Vector3.new(-51, 8, -44.5), Vector3.new(-60, 8, -44.5),
- Vector3.new(-42, 8, -67.5), Vector3.new(-51, 8, -67.5), Vector3.new(-60, 8, -67.5),
- Vector3.new(-72, 5, -54), Vector3.new(-72, 5, -58),
- }
- local Part = Instance.new('Part')
- Part.Size = Vector3.new(2, 2, 2)
- Part.Anchored = true
- function GivePart(Position)
- local Debounce = false
- local Event
- local NewPart = Part:Clone()
- NewPart.Position = Position
- NewPart.Parent = workspace
- local Tool = Loot[math.random(1, #Loot)]
- if Tool == 'Explode' then
- NewPart.BrickColor = BrickColor.new('Really red')
- else
- repeat wait() NewPart.BrickColor = BrickColor:Random() until NewPart.BrickColor ~= BrickColor.new('Really red')
- end
- if Tool == 'bow' then
- NewPart.Reflectance = 1
- end
- Event = NewPart.Touched:Connect(function(Hit)
- local Player = Players:GetPlayerFromCharacter(Hit.Parent)
- if not Debounce and Player then
- Debounce = true
- NewPart:Destroy()
- if Tool == 'Shield' and not Hit.Parent:FindFirstChild('Shield') then
- ServerStorage.Shield:Clone().Parent = Hit.Parent
- elseif Tool == 'Explode' then
- local E = Instance.new('Explosion')
- E.Parent = NewPart
- E.Position = NewPart.Position
- elseif Tool == 'bow' then
- local NewTool = ServerStorage:FindFirstChild(Tool):Clone()
- NewTool.Parent = Player.Backpack
- wait(30)
- NewTool:Destroy()
- elseif ServerStorage:FindFirstChild(Tool) then
- ServerStorage:FindFirstChild(Tool):Clone().Parent = Player.Backpack
- end
- wait(1)
- Event:Disconnect()
- end
- end)
- end
- for i,v in pairs(Positions) do
- GivePart(v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement