Alright so, lemme start from the beggining.
Around 3 days ago, I started making a Cutscene Plugin. And it went just fine! Everything worked, and I released the plugin, however, something just… broke. I’m not sure what happened. Here is the problem:
The cutscenes start when you touch a brick. They use the .Touched event. But they just don’t work. Like, at all. Not even a TouchInterest or TouchTransmitter gets created. Also, the bricks do have their CanTouch property on, yes.
The weird thing is, they worked perfectly 3 hours ago. I didn’t make any changes to the script, it just broke by itself, somehow. I guess I could use a loop with the new OverlapParams thing, but I’d much rather do it with events.
If you are wondering, I took the plugin down. I’ll make it public again after this gets fixed.
It’s not a script in each brick, it’s 1 script in ServerScriptService that goes through all cutscenes and connects the function to their start brick.
Here’s the script, if it helps anything.
local http = game:GetService("HttpService")
local players = game:GetService("Players")
local event = game:GetService("ReplicatedStorage"):WaitForChild("SteelCutsceneHandler")
local coolDownName = "CutscenePlaying"
local function ModelIsInPart(model: Model, part: BasePart)
for _, touching in ipairs(workspace:GetPartBoundsInBox(part.CFrame, part.Size * 1.25, OverlapParams.new())) do
if touching:IsDescendantOf(model) then
return true
end
end
return false
end
for _, model in ipairs(workspace:GetDescendants()) do
if model:IsA("Model") then
local length = model:FindFirstChild("FrameLengthData")
if length then
local frames = {}
for _, child in ipairs(model:GetChildren()) do
if tonumber(child.Name) then
child:ClearAllChildren()
child.Transparency = 1
child.CanCollide = false
table.insert(frames, child)
end
end
local frameData = {
frameSpeed = http:JSONDecode(length.Value),
tweenStyle = Enum.EasingStyle[model.TweenStyle.Value],
skippable = model.Skippable.Value,
walkable = model.Walkable.Value,
fov = model.FOV.Value
}
for _, frame in ipairs(frames) do
frameData[frame.Name] = frame
end
local start = model:WaitForChild("Start")
start:ClearAllChildren()
start.Touched:Connect(function(hit)
local char = hit.Parent
if not char then return end
local player = players:GetPlayerFromCharacter(char)
if (player and char.Humanoid:GetState().Name ~= "Dead" and not player:FindFirstChild(coolDownName)) then
local function TagPlayer(otherPlayer: Player)
local playerHasFinishedCutscene
local coolDownTag = Instance.new("ObjectValue")
coolDownTag.Name = coolDownName
coolDownTag.Parent = otherPlayer
while not playerHasFinishedCutscene do
local finishedPlayer = event.OnServerEvent:Wait() -- This would only fail if 2 players played the same cutscene (or a cutscene with the same length) at the EXACT same time.
if finishedPlayer == otherPlayer then
playerHasFinishedCutscene = true
end
end
if otherPlayer.Character then
repeat task.wait() until not ModelIsInPart(otherPlayer.Character, start)
end
coolDownTag:Destroy()
coolDownTag = nil
end
if model["1PlayerExclusive"].Value then
task.spawn(TagPlayer, player)
event:FireClient(player, frameData)
else
for _, otherPlayer in ipairs(players:GetPlayers()) do
task.spawn(TagPlayer, otherPlayer)
event:FireClient(otherPlayer, frameData) -- If we're already gonna iterate over all players, then why use FireAllClients?
end
end
end
end)
end
end
end
That’s not the problem. The problem is that the event never fires. Even if I connect it in another place, it just does not fire for the starter bricks.
I have done this already, as i’ve said, it does not fire (print anything in this case)
It might also help that a touchtransmitter or touchinterest is never created.
Yes. The touched event is the problem here. It’s not doing anything. Connection works fine, no errors in the output, it just never fires or makes touchtransmitters/interests
Alright, sorry for making this thread before testing it in an actual game. It worked fine. Still begs the question however, what happened, and why? I even reseted Studio multiple times. Hmm.