local script:
f= true
local mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.Parent.Equipped:Connect(function()
mouse.Button2Down:Connect(function()
if f then
f = false
if game.Workspace:FindFirstChild("orangeportal") then
game.Workspace.orangeportal:Destroy()
end
local orangeportal = Instance.new("Part",game.Workspace)
orangeportal.CanCollide = false
orangeportal.Size = Vector3.new(2,8,2)
orangeportal.Anchored = true
orangeportal.Name = "orangeportal"
orangeportal.BrickColor = BrickColor.new("Neon orange")
orangeportal.CFrame = CFrame.new(mouse.Hit.p)
orangeportal.Touched:Connect(function(hit)
if game.Workspace:FindFirstChild("blueportal") then
hit.CFrame = CFrame.new(game.Workspace.blueportal.CFrame.lookVector * 10)
else
return
end
end)
wait()
f = true
end
end)
end)

4 comments
ye i tried this but it dont work the way i want it to work
also i want it to only do that when i click mouse button 2
Oh, I see.
Within the parameters of the equipped event you should put Mouse, and then you can use it wherever.