How would i use a remote event for my localscript?
I have a local script that explains what i want the event to do. this is the script:
01 | local event = game.ReplicatedStorage.DoCutsceneEvent |
02 | local TweenService = game:GetService( "TweenService" ) |
03 | local Camera = game.Workspace.CurrentCamera |
05 | local function MoveCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection) |
06 | Camera.CameraType = Enum.CameraType.Scriptable |
07 | Camera.CFrame = StartPart.CFrame |
08 | local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), { CFrame = EndPart.CFrame } ) |
13 | local function Cutscene() |
14 | MoveCamera(game.Workspace.Cutscene 1 A, game.Workspace.Cutscene 1 B, 3 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out) |
16 | game.Workspace.Truck.Truckdoor.Transparency = 1 |
17 | game.Workspace.Truck.Truckdoor.Graffiti.Transparency = 1 |
18 | game.Workspace.Truck.Truckdooropen.Transparency = 0 |
20 | MoveCamera(game.Workspace.Cutscene 1 B, game.Workspace.Cutscene 1 A, 3 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out) |
22 | Camera.CameraType = Enum.CameraType.Custom |
23 | Camera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild( "Humanoid" ) |
29 | event.OnClientEvent:Connect( function () |
that was in the local script. i want to fire the event from a regular script and this is what i used:
1 | local Cutscene = game.ReplicatedStorage.DoCutsceneEvent |
I've tried many things, but nothing worked. I need help, any thoughts would help.