Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player =script.Parent.Parent.Parent
- m = Player:GetMouse()
- wand = script.Parent
- function eq()
- wand.Eq.Value = true
- end
- wand.Equipped:connect(eq)
- function uneq()
- wand.Eq.Value = false
- end
- wand.Unequipped:connect(uneq)
- n = false
- on = false
- spell1 = false
- m.KeyDown:connect(function(key)
- if wand.Eq.Value ==false then return end
- if wand.SpellActive.Value == true then return end
- if key =='y' then
- if spell1 ==false then
- spell1 = true
- if on ==false then
- on =true
- if m.Target ~=nil then
- x = m.Target
- if x.Parent.ClassName =='Tool' then
- n = true
- end
- chat = wand.SpellN:clone()
- chat.Parent = Player.Character.Head
- chat.Enabled = true
- if m.Target.Anchored ==true or m.Target.Locked ==true then return end
- if n == false then
- --game:GetService("Chat"):Chat(Player.Character.Head, "Accio " ..x.Name)
- chat.SpellName.Text = 'Accio' ..x.Name
- print("accio" ..x.Name)
- elseif n ==true then
- --game:GetService("Chat"):Chat(Player.Character.Head, "Accio " ..x.Parent.Name)
- chat.SpellName.Text = 'Accio' ..x.Parent.Name
- print('accio' ..x.Parent.Name)
- end
- accio = Instance.new("BodyPosition", x)
- accio.position = Player.Character["Right Arm"].Position
- accio.Parent.Touched:connect(function(hit)
- local bp = Player.Character:GetChildren()
- if hit == Player.Character.Torso or hit == Player.Character["Right Arm"] or hit == Player.Character["Left Arm"]then
- accio.maxForce = Vector3.new(0,0,0)
- x.Anchored = true
- wait(0.01)
- x.Anchored = false
- on = false
- spell1 = false
- on = false
- n = false
- end
- end)
- spell1 = false
- on = false
- game.Debris:AddItem(accio, 4)
- n = false
- Player.Character.Head.SpellN:Destroy()
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement