Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My RemoteEvent isn't working properly. (?)

Asked by 5 years ago
Edited 5 years ago

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. lua -- 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.) ```lua -- 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!

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 bojigglesmister2 2 — 5y
0
Oh. I did not know this. sorry! VikingCatto 15 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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!

Ad

Answer this question