local User = game.Players.LocalPlayer.Character local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
local function MercuryLightningMeteorAttack(key) key = key:lower() if key == "q" then local Meteor = Instance.new("Part",workspace) Meteor.Shape = 0 Meteor.Material = 288 Meteor.Name = "Meteor" Meteor.Anchored = true Meteor.Size = Vector3.new(6.33,6.33,6.33)
local MercuryLightning = Instance.new("ParticleEmitter",Meteor) MercuryLightning.Texture = "rbxassetid://567502351" MercuryLightning.Size = NumberSequence.new(10) MercuryLightning.Name = "MercuryLightning" MercuryLightning.Lifetime = NumberRange.new(0.7) MercuryLightning.Rate = 20 MercuryLightning.Rotation = NumberRange.new(1) MercuryLightning.RotSpeed = NumberRange.new(50) local MercuryLightningAura = Instance.new("ParticleEmitter",Meteor) MercuryLightningAura.Texture = "" local MercuryLightningMeteorAttackSpeed = Instance.new("BodyVelocity",Meteor) MercuryLightningMeteorAttackSpeed.MaxForce = Vector3(math.huge,math.huge,math.huge) MercuryLightningMeteorAttackSpeed.Velocity = User.Torso.CFrame.LookVector*80 end
MercuryLightningMeteorAttack()
Lately, I been trying to make a keydown that will summon a lightning ball from my body but the keydown is causing the whole problem here why isn't it working?
Might I recommend some orderly adjustments:
*Also, you don't need to use Debounce, keys are made to press over and over- however.. If it was a .Touched or .Changed or anything that can loop infinitely, it would be needed. *
An example of Debounce can be as simple as:
-- || Variables || local Part = Instance.new("Part", game.Workspace") Part.Position = Vector3.new(0,15,0) -- So it doesn't fall through the potential baseplate I'm assuming you have. local Debounce = false -- || Touch Function || Part.Touched:connect(function(Hit) if Hit.Parent:FindFirstChildOfClass("Humanoid") and not Debounce then Debounce = true print(Hit.Parent.." has hit Part!") wait(2) Debounce = false end end)
Additionally: Look up UserInputService, it'll be more ideal for what you're doing, .GetMouse() is considered Depicted EDIT: For Keyboard Actions..
Switch around User = game.Players.LocalPlayer.Character
and Player = game.Players.LocalPlayer
It'll save you some typing... And won't confuse us as much...
LASTLY: You need to adjust your Code Block, some of your code is illegible.