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

My RemoteEvent isn't working properly. (?)

Through a normal script (code shown below) I'm calling a localscript to handle the user's camera when they hit a part to trigger a cutscene.

-- Regular script
script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		script.RemoteEvent:FireClient(game.Players[hit.Parent.Name])
	end
end)

(The localscript is the child of the RemoteEvent, and the regular script is the parent of the RemoteEvent.)

-- LocalScript
script.Parent.OnClientEvent:Connect(function()
	local cam = workspace.CurrentCamera
	cam.CameraSubject=workspace.complex.tele

	cam.Focus = CFrame.new(workspace.complex.tele.Position) * CFrame.new(0, -4, 0)
end)

Now this looks all well and good, but actually, it doesn't do anything to the camera. I'm not sure what exactly is going on here. Help would be appreciated!

2 comments

1

The local script has to be in the starter pack, or the startergui. you have to define the remote event from the local script and the regular script. I prefer putting the remote event in replicated storage

0

Oh. I did not know this. sorry!

1 answer

The local script has to be in the starter pack, or the startergui. you have to define the remote event from the local script and the regular script. I prefer putting the remote event in replicated storage

Thank you for pointing this out, @bojigglesmister2!

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