local ClonedScript = game.ServerScriptService.ClonedScripts:FindFirstChild("HatchingTimeScript"):Clone()
ClonedScript.Parent = eggValue--Parent the script to the egg folder
local HatchingTimeEvent = ClonedScript:FindFirstChild("HatchingTimeEvent")
HatchingTimeEvent:Fire()--Fire the bindable event so the script starts to work
print("fired")
The print prints so apparently it’s firing but the script that receives it isn’t printing anything even though it has a print meaning it’s somehow not receiving it, which I don’t know why.
local BindableEvent = script:FindFirstChild("HatchingTimeEvent")
local function deductTime()
print("got the event")
end
BindableEvent.Event:Connect(deductTime)
I believe it has to do with you cloning it and the .Event connection not connecting to the cloned script. Where is the deductTime() script located? An easier and probably the most efficient way is to probably put the BindableEvent in ReplicatedStorage. This way all the scripts can access it.
Well in another script which also clones an object and sends a bindable event it works for some reason
local newTemplate = script.PetTemplates:FindFirstChild(pet):Clone()|
local newTemplate = script.PetTemplates:FindFirstChild(pet):Clone()
newTemplate.Name = pet
newTemplate.Parent = scrollingFrame
local SessionID = newTemplate.SessionID
SessionID:Fire(pet, ID, Level)--Makes the pet stats show the correct level
I also only want it to fire to that one cloned script.