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

Camera Minipulation Going Back To Part After Resetting?

Hello all, I've been having a lot of trouble with this lately so here goes.

I am attempting to create a prison game, and like the game "Prison Life" you choose guards or inmates. So I've gotten up to the point where I am viewing the baseplate with a part once joined. But with another script, I run "player:LoadCharacter" and it sends me back to the viewing part. I tried without the load character and I reset my character and it went back to the part. So what I need is to disable the script from running after resetting my character. The script for the part is located in StarterCharacterScripts.

Here is my team change script (to handle remote event) (In: ServerScriptService)

-- Handle RemoteEvent

game.ReplicatedStorage.ChangeTeam.OnServerEvent:Connect(function(player,teamColor)
	player.TeamColor = teamColor
	wait(1)
        -- below is what is causing the problem, but resetting causes it as well
	player:LoadCharacter()
end)

Here is my Local Script that changes the team (not the whole script) (In: ScreenGUI)

frame.Inmates.MouseButton1Click:Connect(function()
	RemoteEvent:FireServer(BrickColor.new(InmateColor))
	frame.Visible = false
	print("running camera switch back")
	Camera.CameraType = "Custom"
end)

2 answers

I'm not exactly brilliant with this stuff either but here's my attempt. I assume this is on a GUI button click. In a onClick function, you can put a line of code either destroying the script or a line of code setting the LocalScript to disabled.

Destroying a script would look something like this:

script.Destroy()

or you can disable the LocalScript

game.StarterGui.GuiGoesHere.LocalScript.Disabled = true

I haven't tested either of these, I could be wrong, but just experiment with them.

1 comment

0

Great suggestion, however I tried both of these and it would not work. Roblox clones scripts and script.Destroy() or disabling the script would be unfortunately useless. (at least what I found online)

In the local script on line 5, change it to

Camera.CameraType = Enum.CameraType.Custom

Maybe this will work

2 comments

0

Have tried this before, unfortunately nothing did change as its just another way of saying custom.

0

Can I see the script that changes the camera type to scriptable?

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