hello there, I’m an builder with decent 1 year of experience of building in roblox studio who is trying to make an RPG game with an reupload of EverCyan’s RPG kit, but I wanted to make when boss mobs despawns, it will also run the respawnscript inside same model when despawnscript runs and it despawns the boss model. but I don’t know how exactly, so I will be glad to get help from you peoples
(if any one of you guys know about EverCyan’s RPG kit, but it’s been months since the original kit is gone offsale so I think there is some peoples who doesn’t know about it.)
I want to make it so when the despawnscript inside the boss model named “GoblinLord” runs, it will trigger an remoteEvent inside folder inside Replicatedstroage, and the respawnscript inside same model notices when remoteEvent is triggered and will trigger the entire script when remoteEvent is triggered.
so here is two scripts containing an despawnscript and respawnscript, it would be so awesome if you guys could fix the script so despawnscript runs the specific remoteEvent in replicatedstorage and respawnscript detects when remoteEvent is triggered and when it detects the remoteEvent, it will run that respawnscript again, it will be pleasure to see that script worked as I wished. also here is also entire model of that GoblinLord, so here it is, in the below.
--this is an despawnscript.
task.wait(120)
script.Parent:Destroy() --I wanna make it so script would run remoteEvent in ReplicatedStorage when this script is triggered, and it makes it so RespawnScript inside MobLoader runs when remoteEvent is triggered.
--this is an respawnscript.
local _M = require(script.Parent.MobConfig) --I want to call this script when Workspace.GoblinLord.DespawnScript runs, my idea is to use the remoteevent for it, so when despawnscript triggers, it also triggers remoteevent related to it and when remoteevnet is triggered, this script would run also.
local Mob = script.Parent
local Enemy = Mob.Enemy
MobClone = Mob:Clone()
function Respawn()
if (not Mob) then return end
script.Parent:BreakJoints()
wait(_M.RespawnTime)
script.Parent:Destroy()
MobClone.Parent = workspace:WaitForChild("Mobs")
MobClone:MakeJoints()
end
Enemy.Died:Connect(Respawn)
-- By Evercyan (https://www.roblox.com/users/111334263/profile)
as I say as always, thanks for the generous helps. -mari