So I am trying to create a scope and I tested it using the Z key which's script I am pretty sure I long sense removed the scripting to. I want it to my tool activated the scope when mousebutton1 is down but deactivated the scope when mouse button1 is up but it won't work. It wants me to define "Mouse" and I am not sure what to make it.
Tool = script.Parent
Player = game.Players.LocalPlayer
Cam = game.Workspace.CurrentCamera
Tool.Unequipped:connect(function()
Cam.FieldOfView = 80
Player.CameraMode = "Classic"
if Player.PlayerGui:FindFirstChild("Scope") ~= nil then
Player.PlayerGui.Scope:Destroy()
end
end)
Mouse.Button1Down:connect(function()
zoomed = true
Cam.FieldOfView = 20
Player.CameraMode = "LockFirstPerson"
if Player.PlayerGui:FindFirstChild("Scope") == nil then
script.Parent.Scope:Clone().Parent = Player.PlayerGui
end
end)
Mouse.Button1Up:connect(function()
zoomed = false
Cam.FieldOfView = 80
Player.CameraMode = "Classic"
if Player.PlayerGui:FindFirstChild("Scope") ~= nil then
Player.PlayerGui.Scope:Destroy()
end
end)
Tool.Equipped:connect(function(Mouse)
end)
