Hi all
-
What do you want to achieve? I wanted a remote event to be fired in the middle of a tween script.
-
**What is the issue?**when the script come to the line in which the event is being fired the second tween wont play and the other script wont be able to detect the event being fired
The script which is fireing the event
local Car = game.Workspace.Car
local Destination1 = game.Workspace.Car1
local Destination2 = game.Workspace.Car2
local TweenService = game:GetService("TweenService")
local CarTweenInfo = TweenInfo.new(5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0)
local CarTween = TweenService:Create(Car, CarTweenInfo, {CFrame = Destination1.CFrame})
local CarTween2 = TweenService:Create(Car, CarTweenInfo, {CFrame = Destination2.CFrame})
game.ReplicatedStorage.CarTrigger.OnServerEvent:Connect(function()
CarTween:Play()
game.Workspace["Car Engine"]:Play()
game.ReplicatedStorage.CutsceneTrigere:FireClient()
CarTween2:Play()
wait(4.8)
game.Workspace["Car Engine"].Looped = false
game.Workspace["Car Stop 1.1"]:Play()
script.Parent.Tween.Disabled = true
end)
The script which is detecting the event being fired:
wait(9)
local TweenService = game:GetService("TweenService")
local camera = game.Workspace.CurrentCamera
local Desto = game.Workspace.Desto
local tweenInfo = TweenInfo.new(12, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
function tween(part1,part2)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part1.CFrame
local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame})
tween:Play()
wait(13)
game.Workspace.Angle4.Transparency = 0
wait(0.4)
game.Workspace["car door"]:Play()
wait(6)
for _, player in pairs(game.Players:children())do
local char = player.Character
char.HumanoidRootPart.CFrame = Desto.CFrame
end
camera.CameraType = Enum.CameraType.Custom
end
game.ReplicatedStorage.CutsceneTrigere.OnClientEvent:Connect(function()
tween(game.Workspace.Angle2, game.Workspace.Angle3)
wait(12)
end)
Note:The Script which is fireing the event is a server script and the detecting script is a local script.
Thank You
