I tried to make kill brick in Roblox Studio for my game, using “GetInstanceAddedSignal”, but it didn’t work and I found it really odd, I thought I made some typo, but clearly not, I asked other devs about it, they couldn’t find any issue here too, so I suggest it may be a studio bug, I tried to debug but it completely skips it, I tried to do it in clear workspace, reinstalled studio and turning off plugins.
But nothing works, I debugged it, works but doesn’t send signal so it skips function on video.
Maybe I’m wrong, but I tried using official docs example with deadly brick, it doesn’t work too: CollectionService | Documentation - Roblox Creator Hub
Also checked recent posts on Dev Forum couldn’t find something relatable, so now reporting it.
Here is my code:
local ServerScriptService = game:GetService("ServerScriptService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
--Modules:
local Modules = ServerStorage.Modules
--Functions
-- Connect to Laser tag additions
CollectionService:GetInstanceAddedSignal("Laser"):Connect(function(part)
local function onTouched(otherPart)
local character = otherPart.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(10)
end
end
part.Touched:Connect(onTouched)
end)
Expected behavior
I expected my humanoid to get damage or print any result from function, but it skips it when I debug it.
Edit: Forgot to add, that when I ran Roblox Official Documentation example, it takes longer for studio and overall using GetInstanceAddedSignal makes studio longer to load.