Sorry, I know I’m annoying and I always ask geniuses for help. Well, My script should be executed with the Scroll of my mouse, but it does not execute with a ScrollFrame but in a normal Frame.
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded
local hum = char:WaitForChild("Humanoid")
local humRootPart = char:WaitForChild("HumanoidRootPart")
local map = workspace:WaitForChild("UrbanHouse")
local ViewPortFrame = script.Parent:WaitForChild("Minimap2")
local mouse = script.Parent
local cam = Instance.new("Camera")
cam.Parent = script.Parent.Minimap2
cam.CameraType = Enum.CameraType.Scriptable
cam.DiagonalFieldOfView = 5
ViewPortFrame.CurrentCamera = cam
for i, minimapObjects in pairs(map:GetChildren()) do
minimapObjects:Clone().Parent = ViewPortFrame
end
function MasTransparency ()
if cam.DiagonalFieldOfView < 10 then
cam.DiagonalFieldOfView += 0.5
end
end
function MenosTransparency ()
if cam.DiagonalFieldOfView > 0.5 then
cam.DiagonalFieldOfView -= 0.5
end
end
function EnabledScroll ()
script.Parent.ScrollingEnabled = false
end
function FalsedScroll ()
script.Parent.ScrollingEnabled = true
end
mouse.MouseWheelBackward:Connect(MasTransparency)
mouse.MouseWheelForward:Connect(MenosTransparency)
ViewPortFrame.MouseEnter:Connect(EnabledScroll)
ViewPortFrame.MouseLeave:Connect(FalsedScroll)
game:GetService("RunService").RenderStepped:Connect(function()
local camFr = CFrame.new(humRootPart.Position+Vector3.new(0, 3000, 0), humRootPart.Position)
cam.CFrame = camFr
ViewPortFrame:WaitForChild("Arrow").Rotation = -humRootPart.Orientation.Y -90
end)