Okay, so the section of the script that I am working on is meant to pick random part from a selection and is to copy a script into the selected part

if gameChoosing == 1 then
		local NormalScript = game.ReplicatedStorage.Fire:FindFirstChild("FireSpreadNormal")
		gameChosen.Value = "Normal"

		local parts = map.FireStarts:GetChildren() --- picking a random part
		local FireStart = parts[math.random(1, #parts)]

		local scriptCopy = NormalScript:Clone() ----- giving the chosen part the script
		scriptCopy.Parent = FireStart
		print(FireStart.Name)
		FireStart.Anchored = false
end

The script succefully adds the cloned script into FireStart. However, the cloned script is shortly deleted. I have no idea why this is happening.

2 comments

0

Bunch of reasons this could be happening. These types of bugs are always the most annoying. Is there anywhere you intentionally delete the script or FireStart part in your game logic? If so, check that that code isn't running early.

0

We need to see the "NormalScript"'s code too.