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

Very Noobie scripter needing help with simple script??

Hey, I'm a noob at scripting and I'm trying to write a script that changes the camera angles form Top view (TCAM) to a side View (SCAM) when you touch a brick, I know I'm doing something pretty wrong here. I've been stuck on this for a while now and any feedback is appreciated.

thanks,

-Btw the brick is hovering so that shouldn't be a problem -It's also in a normal script

game.Workspace.CHECK1.Touched:Connect(function()
	print(5)
		game.ReplicatedStorage.SCAM.Parent = game.StarterGui
			game.StarterGui.TCAM.Parent = game.ReplicatedStorage
		
		
	
	end)

2 comments

0

What type of instance is SCAM and TCAM ?

0

Ohh sorry, they are both local scripts with the camera angles in them. TCAM being the top camera angle and SCAM being the side camera angle, each camera angle works fine alone.

1 answer

✓ Accepted answer

Hello! You need to Insert a Script in the Part and place this:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("HumanoidRootPart") then -- When the player touches the part, it will execute the following script.
    print(5)
        game.ReplicatedStorage.SCAM.Parent = game.StarterGui
            game.StarterGui.TCAM.Parent = game.ReplicatedStorage
    end
end

I hope that helps you. Good luck.

2 comments

0

The part already has a script in it

0

Hmm, thanks for the reply but I keep getting the same error in the output, " SCAM is not a valid member of ReplicatedStorage". I've checked over and over again and SCAM is definitely a child of ReplicatedStorage...

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