Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Code for Lesson 2 of Matt's Roblox Coding Course on SS
- --Copy-paste this code into your script!
- math.randomseed(tick())
- script.Parent.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- script.Disabled = true
- local player = hit.Parent.Name
- local num = 0
- for i = 1,45 do
- wait()
- script.Parent.CFrame = ( CFrame.new(script.Parent.Position) * CFrame.Angles(0,math.rad(num),0) )
- script.Parent.Part.CFrame = ( CFrame.new(script.Parent.Part.Position) * CFrame.Angles(0,math.rad(num),0) )
- num = num + 8
- end
- num = 0
- local random = math.random(1,100)
- if random > 0 and random < 50 then
- local sword1 = game.ServerStorage.Sword1:Clone()
- sword1.Parent = game.Players[player].Backpack
- elseif random > 50 and random < 100 then
- local sword2 = game.ServerStorage.Sword2:Clone()
- sword2.Parent = game.Players[player].Backpack
- end
- script.Parent:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement