Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait()
- local next=next
- local pcall=pcall
- local d=script.Distance
- local p=script.Player
- local t=script.Target
- local s=script.Spellpower
- local c=script.CritChance
- local casting=p.Value.Backpack.Casting
- local mana=p.Value.Backpack.Mana
- local manacap=p.Value.Backpack.MaxMana
- local th=t.Value.Health
- local oldC=c.Value
- local function randomChance(percent)
- return percent>=math.random(1,100)
- end
- local function sendmsg(text,c)
- local thing=Instance.new("StringValue",game.Workspace)
- thing.Name="SpellDamage"
- thing.Value=text
- local thing2=Instance.new("BoolValue",thing)
- thing2.Name=t.Value.Parent.Name
- thing2.Value=c
- wait()
- thing:Destroy()
- end
- local function animLance()
- end
- pcall(function()
- if not casting.Value==true then
- casting.Value=true
- local dmg=((.335*s.Value)+math.random(306,392))
- if t.Value.Frozen.Value==true then
- c.Value=(c.Value*1.5)+50
- mana.Value=mana.Value-(manacap.Value*.01)
- if not randomChance(c.Value) then
- if th.Value-(dmg*4)>=0 then
- th.Value=math.ceil(th.Value-(dmg*4))
- sendmsg(4*dmg,false)
- else
- th.Value=0
- end
- else
- if th.Value-(th.Value-((2*dmg)*3))>=0 then
- th.Value=math.ceil(th.Value-((2*dmg)*3))
- sendmsg(2*dmg*4,true)
- else
- th.Value=0
- end
- end
- casting.Value=false
- script.Disabled=true
- script:Destroy()
- else
- mana.Value=mana.Value-(manacap.Value*.01)
- c.Value=oldC
- if not randomChance(c.Value) then
- if th.Value-(th.Value-(dmg))>=0 then
- th.Value=math.ceil(th.Value-(dmg))
- sendmsg(dmg,false)
- else
- th.Value=0
- end
- else
- if th.Value-(2*dmg)>=0 then
- th.Value=math.ceil(th.Value-(2*dmg))
- sendmsg(2*dmg,true)
- else
- th.Value=0
- end
- end
- casting.Value=false
- script.Disabled=true
- script:Destroy()
- end
- else
- script.Disabled=true
- script:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement