Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Someone fix this?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I need a fix for this script so the script can run when the players join and it makes the camera freeze. This is the script of the tool to freeze:

function onButton1Down(mouse)
    L = Instance.new("Part")
    L.Parent = game.Workspace
    L.Name = game.Players.LocalPlayer.Name.. "'s Camera"    
    L.Position = game.Workspace.CurrentCamera.Focus.p
    L.Anchored = true
    L.CanCollide = false 
    L.Transparency = 1
    game.Workspace.CurrentCamera.CameraSubject = L
    game.Workspace.CurrentCamera.CameraType = 4

end

function onButton1Up(mouse)
        L:remove()
        game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Head
        game.Workspace.CurrentCamera.CameraType = 4
end

function onSelected(mouse)
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
    mouse.Button1Up:connect(function() onButton1Up(mouse) end)
end

script.Parent.Selected:connect(onSelected)

0
Please make your question title relevant to your question content. It should be a one-sentence summary in question form. AmericanStripes 610 — 9y
1
Looks to me you're trying to make a event out of a property. All you have to do is remove lines, 20,23, and 25. And removed "mouse" from the parenthesis on lines 21, and 22. M39a9am3R 3210 — 9y

1 answer

Log in to vote
0
Answered by
Rdite 30
9 years ago
function onButton1Down(mouse)
    L = Instance.new("Part")
    L.Parent = game.Workspace
    L.Name = game.Players.LocalPlayer.Name.. "'s Camera"    
    L.Position = game.Workspace.CurrentCamera.Focus.p
    L.Anchored = true
    L.CanCollide = false 
    L.Transparency = 1
    game.Workspace.CurrentCamera.CameraSubject = L
    game.Workspace.CurrentCamera.CameraType = 4

end

function onButton1Up(mouse)
        L:remove()
        game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Head
        game.Workspace.CurrentCamera.CameraType = 4
end

    mouse.Button1Down:connect(function() onButton1Down() end)
    mouse.Button1Up:connect(function() onButton1Up() end)



That should work?

Ad

Answer this question