Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uis = game:GetService("UserInputService")
- local runs = game:GetService("RunService")
- local plr = game.Players.LocalPlayer
- local target = nil
- local anim = Instance.new("Animation")
- anim.AnimationId = "rbxassetid://126753849"
- local summoned = false
- local e
- local prevora = tick()+1
- local mode = "Idle"
- local connect = {}
- uis.InputBegan:Connect(function(input, istpying)
- if istpying then return end
- if input.KeyCode == Enum.KeyCode.E then
- mode = "Barrage"
- end
- if input.KeyCode == Enum.KeyCode.Q then
- summoned = not summoned
- end
- end)
- uis.InputEnded:Connect(function(input, istpying)
- if istpying then return end
- if input.KeyCode == Enum.KeyCode.E then
- mode = "Idle"
- end
- end)
- plr.Chatted:Connect(function(msg)
- local split = string.split(msg, ":")
- if split[1] == "sel" then
- summoned = false
- target = game.Players:FindFirstChild(split[2])
- if e then e:Disconnect() end
- e = target.Chatted:Connect(function(msg)
- if string.match(string.lower(msg), "barrage") then
- mode = "Barrage"
- delay(3, function()
- mode = "Idle"
- end)
- end
- if msg == plr.Name.."!" then
- summoned = not summoned
- end
- end)
- end
- end)
- local cfram = CFrame.new()
- local function fastrun()
- if target ~= nil then
- plr.Character.Humanoid.PlatformStand = false
- workspace.CurrentCamera.CameraSubject = target.Character.Head
- if summoned == true then
- if mode == "Idle" then
- cfram = cfram:Lerp(target.Character.HumanoidRootPart.CFrame * CFrame.new(-1,1+math.sin(tick()*2),2), 0.1)
- else
- if tick() > prevora then
- prevora = tick()+1
- end
- cfram = cfram:Lerp(target.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-6-math.sin(tick()*40)*3) * CFrame.Angles(0,-math.rad(math.sin(tick()*40)*45),math.rad(math.cos(tick()*20)*30)), 0.1)
- end
- else
- cfram = cfram:Lerp(CFrame.new(0,1000,0), 0.4)
- end
- plr.Character.HumanoidRootPart.Velocity = Vector3.new()
- plr.Character.HumanoidRootPart.CFrame = cfram
- else
- workspace.CurrentCamera.CameraSubject = plr.Character.Head
- plr.Character.Humanoid.PlatformStand = false
- end
- end
- table.insert(connect, runs.Heartbeat:Connect(fastrun))
- table.insert(connect, runs.Stepped:Connect(fastrun))
- table.insert(connect, runs.RenderStepped:Connect(fastrun))
- plr.Chatted:Connect(function(msg)
- if msg == "stop" then for i, v in pairs(connect) do v:Disconnect() end end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement