Advertisement
Plexplayer118

SS RBXL Class Lesson 2

Oct 14th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. --Code for Lesson 2 of Matt's Roblox Coding Course on SS
  2. --Copy-paste this code into your script!
  3.  
  4.  
  5.  
  6. math.randomseed(tick())
  7.  
  8. script.Parent.Touched:connect(function(hit)
  9.  
  10. if hit.Parent:FindFirstChild("Humanoid") then
  11. script.Disabled = true
  12.  
  13. local player = hit.Parent.Name
  14.  
  15. local num = 0
  16. for i = 1,45 do
  17. wait()
  18. script.Parent.CFrame = ( CFrame.new(script.Parent.Position) * CFrame.Angles(0,math.rad(num),0) )
  19. script.Parent.Part.CFrame = ( CFrame.new(script.Parent.Part.Position) * CFrame.Angles(0,math.rad(num),0) )
  20. num = num + 8
  21. end
  22. num = 0
  23.  
  24.  
  25. local random = math.random(1,100)
  26.  
  27. if random > 0 and random < 50 then
  28. local sword1 = game.ServerStorage.Sword1:Clone()
  29. sword1.Parent = game.Players[player].Backpack
  30.  
  31. elseif random > 50 and random < 100 then
  32. local sword2 = game.ServerStorage.Sword2:Clone()
  33. sword2.Parent = game.Players[player].Backpack
  34. end
  35.  
  36. script.Parent:Destroy()
  37.  
  38. end
  39.  
  40. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement