RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a script inside a tool that create a fire ball projectile when player press E"
-- local script inside a tool local tool = script.Parent local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse() local function createFireball() local fireball = Instance.new("Part") fireball.Name = "Fireball" fireball.Shape = "Ball" fireball.Size = Vector3.new(2, 2, 2) fireball.BrickColor = BrickColor.new("Bright red") fireball.Material = "Neon" fireball.Parent = workspace fireball.Position = player.Character.HumanoidRootPart.Position + Vector3.new(0, 2, 0) local fire = Instance.new("Fire", fireball) fire.Size = 2 fire.Heat = 10 local bodyVelocity = Instance.new("BodyVelocity", fireball) bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) bodyVelocity.Velocity = (mouse.Hit.p - fireball.Position).unit * 100 game:GetService("Debris"):AddItem(fireball, 3) end local function onKeyDown(key) if key == "e" or key == "E" then createFireball() end end mouse.KeyDown:Connect(onKeyDown)