In my game, I want that when a Dummy dies, a ClickDetector is activated that is inside a Brick hidden in the map, this Brick gives a sum of 100 numbers to an Int Value in a special folder created within the Local Player, click the Brick does this action, but I would like that action to be executed when the Dummy dies, since I have tried to emulate the ClickDetector action inside the Dummy with a script, but it doesn't work please
COMMUNITY QUESTION
hi i need to know How can i Activate an ClickDetector in a Brick, when a Dummy Die?
1 answer
You can create one function that is then triggered by either clicking the brick, or dying.
local function SampleFunction(player)
print(player.Name)
end
ClickDetector.MouseClick:Connect(SampleFunction)
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
SampleFunction(player)
end)
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
pls help me ; (
please ;u