Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Someone fix this?

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)
	

2 comments

0

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

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.

1 answer

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.