Simple script help

I’ve never really scripted, so I have no idea why this isnt working even though its a elementary script.

The first click works to make the shark uncollidable but not on the second click to make it collidable again.

Please help !

script.Parent.ClickDetector.MouseClick:Connect(function()
	if script.Parent.Value.Value == false then
	game.Workspace.sharkie.shark.CanCollide = false
		game.Workspace.sharkie.shark.Transparency = 0.5
		game.Workspace.Lever.LeverDown.one.Transparency = 0
		game.Workspace.Lever.LeverDown.two.Transparency = 0
		game.Workspace.Lever.LeverUP.three.Transparency = 1
		game.Workspace.Lever.LeverUP.four.Transparency = 1
	else
	game.Workspace.sharkie.shark.CanCollide = true
	game.Workspace.sharkie.shark.Transparency = 0
		script.Parent.Value.Value = false
		game.Workspace.Lever.LeverDown.one.Transparency = 1
		game.Workspace.Lever.LeverDown.two.Transparency = 1
		game.Workspace.Lever.LeverUP.three.Transparency = 0
		game.Workspace.Lever.LeverUP.four.Transparency = 0
	end
end)

You need to set script.Parent.Value.Value to true under the if statement so it knows to disable it on the next click.

I think you forgot to set the “script.Parent.Value.Value” to true.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.