Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mouse Aim and KeyHolding?

Asked by
Jetex_m -5
5 years ago
Player = game.Players.LocalPlayer
Character = Player.Character
Humanoid = Character.Humanoid
Mouse = Player:GetMouse()

unEquipScript = script.Parent["Un/Equip Script"]

MagicCircle = script.Parent.MagicCircle.Value
MagicSound = script.Parent.MagicSound.Value
Animations = script.Parent.Animations
  FireSkill1 = Animations.FireSkill1
  FireSkill2 = Animations.FireSkill2
Damage = script.Parent.Damage
  FireQ = Damage.FireQ
  FireE = Damage.FireE

Mouse.KeyDown:connect(function(key)
    if (key == "q") then

        local FireQAnim = Humanoid:LoadAnimation(Animations.FireSkill1)
        local Current = FireQAnim
        Current:Play()
        local FireCircle = Instance.new("Part")
        FireCircle.Parent = workspace
        FireCircle.Name = "Fire Magic Circle Tier 1"
        FireCircle.Anchored = true
        FireCircle.CanCollide= false
        FireCircle.Transparency = 1
        FireCircle.Size = Vector3.new(5,5,0.05)
        FireCircle.Position = Character.UpperTorso.Position
        FireCircle.Position = FireCircle.Position + Vector3.new(0,0,0)

        local Sound = Instance.new("Sound")
        Sound.Parent = FireCircle
        Sound.SoundId = "rbxassetid://"..MagicSound
        Sound.Pitch = 0.5
        Sound.Volume = 2
        Sound:Play()
        local CircleFront = Instance.new("Decal")
        CircleFront.Parent = FireCircle
        CircleFront.Face = "Front"
        CircleFront.Texture = "rbxassetid://"..MagicCircle
        local CircleBack = Instance.new("Decal")
        CircleBack.Parent = FireCircle
        CircleBack.Face = "Back"
        CircleBack.Texture = "rbxassetid://"..MagicCircle   
        local LightEmit = Instance.new("PointLight")
        LightEmit.Parent = FireCircle
        LightEmit.Brightness = 50 
        LightEmit.Range = 6
        LightEmit.Color = Color3.new(255, 140, 0)
        FireCircle.Orientation = Character.Head.Orientation
        Character.UpperTorso.Anchored = true
        wait(1)
        Character.UpperTorso.Anchored = false   
        while wait(0.01) do 


end

        end

  if (key == "e") then
--  local FireEAnim = Humanoid:LoadAnimation(Animations.FireSkill2)
--  local Current = FireEAnim
--  Current:Play()






end

end)

So I'm trying to make a power or magic for my game in a tool. But Im asking 2 questions, since its kind of hard.

So How do i do mouse over aim(TargetFilter) on changed orientation and key holding?

for key holding. you must hold a bind, if you release it. it will stop or some sort. ty thats all

0
Don't use KeyDown. It is deprecated. User#19524 175 — 5y

Answer this question