Wont Stop Flinging The Player Bruh?
local Mouse = game.Players.LocalPlayer:GetMouse()
local RunService = game:GetService("RunService")
local db = false
local DB = false
local Switch = false
local NotActivated = true
local P1 = script.Parent:WaitForChild('Portal1').Value
local P2 = script.Parent:WaitForChild('Portal2').Value
local Char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local HRP = Char:WaitForChild('HumanoidRootPart')
RunService.RenderStepped:Connect(function()
Mouse.Button1Up:Connect(function()
if not db then
if not NotActivated then
local TargetSurface = Mouse.TargetSurface
if not Switch then
P1.Parent = game.Workspace
P1.Position = Mouse.Hit.p
P1.CFrame = CFrame.new(P1.Position,HRP.Position)
if TargetSurface == Enum.NormalId.Top then
P1.Orientation = Vector3.new(90, 180, 0)
elseif TargetSurface == Enum.NormalId.Front then
P1.Orientation = Vector3.new(0, 0, 180)
elseif TargetSurface == Enum.NormalId.Right then
P1.Orientation = Vector3.new(0, -90, 180)
elseif TargetSurface == Enum.NormalId.Back then
P1.Orientation = Vector3.new(0, 180, 180)
elseif TargetSurface == Enum.NormalId.Left then
P1.Orientation = Vector3.new(0, 90, 180)
elseif TargetSurface == Enum.NormalId.Bottom then
P1.Orientation = Vector3.new(-90, -180, 0)
end
Switch = true
else
P2.Parent = game.Workspace
P2.Position = Mouse.Hit.p
P2.CFrame = CFrame.new(P2.Position,HRP.Position)
if TargetSurface == Enum.NormalId.Top then
P2.Orientation = Vector3.new(90, 180, 0)
elseif TargetSurface == Enum.NormalId.Front then
P2.Orientation = Vector3.new(0, 0, 180)
elseif TargetSurface == Enum.NormalId.Right then
P2.Orientation = Vector3.new(0, -90, 180)
elseif TargetSurface == Enum.NormalId.Back then
P2.Orientation = Vector3.new(0, 180, 180)
elseif TargetSurface == Enum.NormalId.Left then
P2.Orientation = Vector3.new(0, 90, 180)
elseif TargetSurface == Enum.NormalId.Bottom then
P2.Orientation = Vector3.new(-90, -180, 0)
end
Switch = false
end
end
db = true
wait()
db = false
end
end)
P2.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') and not DB then
DB = true
local HRP = hit.Parent.HumanoidRootPart
local throwOffset = 5
local newPos = P1.Position + P1.CFrame.lookVector*throwOffset
HRP.Parent.Humanoid.Jump = true
wait()
HRP.CFrame = CFrame.new(newPos,newPos+P1.CFrame.lookVector)
HRP.Velocity = P1.CFrame.LookVector * 100
wait(2)
DB = false
end
end)
P1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') and not DB then
DB = true
local HRP = hit.Parent.HumanoidRootPart
local throwOffset = 5
local newPos = P2.Position + P2.CFrame.lookVector*throwOffset
HRP.Parent.Humanoid.Jump = true
wait()
HRP.CFrame = CFrame.new(newPos,newPos+P2.CFrame.lookVector)
HRP.Velocity = P2.CFrame.LookVector * HRP.Velocity * 100
wait(2)
DB = false
end
end)
end)
script.Parent.Equipped:Connect(function()
NotActivated = false
end)
script.Parent.Equipped:Connect(function()
NotActivated = true
end)