Advertisement
Firebirdzz

Untitled

May 6th, 2021
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. -- in this script, i made a fireball. this is a local script, it will fireserver a script in the serverscriptservice.
  2.  
  3. Tool.Equipped:Connect(function()
  4. print "ACTIVATED"
  5. CUA4 = true
  6. Tool.Unequipped:Connect(function()
  7. print "DEACTIVATED"
  8. CUA4 = false
  9.  
  10.  
  11.  
  12. --–//Services\–
  13. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  14. local UserInputService = game:GetService("UserInputService")
  15.  
  16. --– Variables----
  17. local player = game.Players.LocalPlayer
  18. local Character = player.Character or player.CharacterAdded:Wait()
  19. local Remote = ReplicatedStorage.Fire.Fireballevent
  20. local Mouse = player:GetMouse()
  21.  
  22. --–//Settings\–
  23. local Debounce = true
  24. local Key = 'Q'
  25.  
  26. UserInputService.InputBegan:Connect(function(Input , IsTyping)
  27. if IsTyping then return end
  28. local KeyPressed = Input.KeyCode
  29. if KeyPressed == Enum.KeyCode[Key] and Debounce and CUA4 == true and Character then
  30. Debounce = false
  31. Remote:FireServer(Mouse.Hit)
  32. print "Fireserver"
  33. wait(.1)
  34. Debounce = true
  35. end
  36.  
  37. end)
  38.  
  39. -- this is the script in serverscriptservice:
  40.  
  41. --–//Services\–
  42. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  43.  
  44. --– Variables----
  45. local Remote = ReplicatedStorage.Fire.Fireballevent
  46.  
  47. --–//Settings\–
  48. local Damage = 30
  49.  
  50. Remote.OnServerEvent:Connect(function(plr, Mouse)
  51. local Character = plr.Character or plr.CharacterAdded:Wait()
  52.  
  53. local Part = Instance.new("Part")
  54. Part.Shape = Enum.PartType.Ball
  55. Part.Anchored = true
  56. Part.CanCollide = false
  57. Part.Transparency = 0.5
  58. Part.Color = Color3.fromRGB(255,0,0)
  59. Part.Material = Enum.Material.Neon
  60. Part.Size = Vector3.new(3,3,3)
  61. Part.Name = "FireBall"
  62. Part.CFrame = Character.HumanoidRootPart.CFrame *CFrame.new (0,10,0)
  63. Part.Parent = workspace
  64.  
  65. local tweenService = game:GetService("TweenService")
  66.  
  67.  
  68. local tweeningInformation = TweenInfo.new(
  69.  
  70. 3,
  71. Enum.EasingStyle.Linear,
  72. Enum.EasingDirection.Out,
  73. 0,
  74. false,
  75. 0
  76. )
  77.  
  78. local partProperties = {
  79. Size = Vector3.new(10,10,10);
  80. Transparency = math.random(0,1)
  81. }
  82.  
  83.  
  84. local Tween = tweenService:Create(Part, tweeningInformation, partProperties)
  85. Tween:Play()
  86.  
  87. wait(3)
  88.  
  89. Part.Anchored = false
  90.  
  91.  
  92. local BodyVelocity = Instance.new("BodyVelocity")
  93. BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  94. BodyVelocity.Velocity = Mouse.lookVector*100
  95. BodyVelocity.Parent = Part
  96. local Debounce = true
  97.  
  98. Part.Touched:Connect(function(h)
  99.  
  100. local tweenService = game:GetService("TweenService")
  101.  
  102.  
  103. local tweeningInformation = TweenInfo.new(
  104.  
  105. 1,
  106. Enum.EasingStyle.Linear,
  107. Enum.EasingDirection.Out,
  108. 0,
  109. false,
  110. 0
  111. )
  112.  
  113. local partProperties = {
  114. Size = Vector3.new(50,50,50);
  115. CFrame = h.Parent.HumanoidRootPart.CFrame;
  116. CFrame = h.CFrame;
  117. Transparency = 1
  118. }
  119. BodyVelocity:Destroy()
  120. Part.Anchored = true
  121. Part.CFrame = h.Parent.HumanoidRootPart.CFrame
  122.  
  123. local Tween = tweenService:Create(Part,tweeningInformation,partProperties)
  124. Tween:Play()
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. end)
  132. end)
  133.  
  134.  
  135. That was the fireball script..
  136.  
  137.  
  138. In 2020, i also found out how to make things for mobile/pc only. It might be the first thing you think about when making a game, but i'm built different.
  139.  
  140. if game:GetService("UserInputService").TouchEnabled == true then
  141. script.Parent.Text = "Device detected: MOBILE"
  142. else
  143. script.Parent.Text = "Device detected: PC"
  144. end
  145.  
  146. flickering light using math.random.
  147.  
  148. while true do
  149. wait(math.random(.1,1))
  150. script.Parent.PointLight.Enabled = false
  151. wait(.1)
  152. script.Parent.PointLight.Enabled = true
  153. end
  154.  
  155. In this script, i made a cutcene system. I tried to use TweenService and EasyingStyle. At that time i almost always used for i = <number1>,<number2> do, so TweenService was new for me.
  156.  
  157. --//Variables
  158.  
  159. local TS = game:GetService("TweenService")
  160. local Camera = game.Workspace.CurrentCamera
  161. wait(1)
  162. player = game.Players.LocalPlayer
  163. button = script.Parent
  164. local debounce = false
  165.  
  166. --//Scripts
  167.  
  168. local function CamWithEasyingStyle(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
  169. Camera.CameraType = Enum.CameraType.Scriptable
  170. Camera.CFrame = StartPart.CFrame
  171. local Cutscene = TS:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
  172. Cutscene:Play()
  173. wait(1)
  174. end
  175.  
  176. local function CamWithoutEasyingStyle (StartPart, EndPart, Duration)
  177. Camera.CameraType = Enum.CameraType.Scriptable
  178. Camera.CFrame = StartPart.CFrame
  179. local Cutscene = TS:Create(Camera, TweenInfo.new(Duration), {CFrame = EndPart.CFrame})
  180. Cutscene:Play()
  181. wait(1)
  182. end
  183. local function Cutscene()
  184. CamWithoutEasyingStyle(game.Workspace.CamA, game.Workspace.CamB, 1)
  185. wait ()
  186. CamWithoutEasyingStyle(game.Workspace.CamB, game.Workspace.CamC, 1)
  187. wait ()
  188. CamWithoutEasyingStyle(game.Workspace.CamC, game.Workspace.CamD, 1)
  189. wait() --0.1
  190. CamWithoutEasyingStyle(game.Workspace.CamD, game.Workspace.CamE, 1)
  191. wait()
  192. CamWithoutEasyingStyle(game.Workspace.CamE, game.Workspace.CamF, 1)
  193. wait()
  194. CamWithoutEasyingStyle(game.Workspace.CamF, game.Workspace.CamG, 1)
  195. game.ReplicatedStorage.RemoteEvent:FireServer(player)
  196. print "fireserver"
  197. wait()
  198. CamWithoutEasyingStyle(game.Workspace.CamG, game.Workspace.CamH, .3)
  199.  
  200.  
  201. script.Parent.Parent.TextLabel.Visible = true
  202. for i = 1,20 do
  203. wait(.1)
  204. script.Parent.Parent.TextLabel.BackgroundTransparency = script.Parent.Parent.TextLabel.BackgroundTransparency - .05
  205. end
  206.  
  207. wait(1)
  208. Camera.CameraType = Enum.CameraType.Custom
  209. Camera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
  210. for i = 1,20 do
  211. wait(.1)
  212. script.Parent.Parent.TextLabel.BackgroundTransparency = script.Parent.Parent.TextLabel.BackgroundTransparency + .05
  213. end
  214. wait(1)
  215. script.Parent.Parent.TextLabel.Visible = false
  216.  
  217. end
  218.  
  219. local Enabled = false
  220. script.Parent.MouseButton1Click:Connect(function()
  221. wait(2)
  222. game.ReplicatedStorage.RemoteEvent2:FireServer(player)
  223. if Enabled == true then return end Enabled = true
  224. Cutscene()
  225. Enabled = false
  226. end)
  227.  
  228.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement