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 tool local tool = script.Parent local player = game.Players.LocalPlayer local mouse = player:GetMouse() local canShoot = true local function createFireball() if canShoot then canShoot = false local fireball = Instance.new("Part") fireball.Size = Vector3.new(2, 2, 2) fireball.Shape = Enum.PartType.Ball fireball.BrickColor = BrickColor.new("Bright red") fireball.Material = Enum.Material.Neon fireball.Parent = game.Workspace fireball.Position = player.Character.Head.Position fireball.Velocity = (mouse.Hit.p - fireball.Position).unit * 100 fireball.CanCollide = false local fire = Instance.new("Fire", fireball) fire.Size = 5 fire.Heat = 10 fire.Color = Color3.fromRGB(255, 0, 0) fire.SecondaryColor = Color3.fromRGB(255, 255, 0) game.Debris:AddItem(fireball, 3) wait(0.5) canShoot = true end end local function onKeyDown(key) if key == "e" or key == "E" then createFireball() end end mouse.KeyDown:Connect(onKeyDown)