It runs through the first time perfectly fine, but if I want to click it a second time I cannot. Been trying to solve it for 10-15 minutes and even took a break from earlier to think about it but can't figure out why.
local blueCrystal = game.Workspace:WaitForChild("Blue_Crystal")
local blueClickDetector = blueCrystal.ClickDetector
local isBlueSpawned = true
local respawnTime = 2 --Incase you don't know it's minutes*60 = respawnTime
blueClickDetector.MouseClick:connect(function(player)
if isBlueSpawned == true then
local playerHumanoid = player.Character.Humanoid
playerHumanoid.WalkSpeed = 40
for i = 0, 1, .1 do
wait()
blueCrystal.Transparency = i
end
isBlueSpawned = false
blueCrystal:Destroy()
wait(respawnTime)
local newCrystal = game.ReplicatedStorage.Blue_Crystal:Clone()
newCrystal.Parent = game.Workspace
blueCrystal = newCrystal
blueClickDetector = newCrystal.ClickDetector
print(blueClickDetector.Parent.Parent)
isBlueSpawned = true
end
end)

2 comments
the error is ranging from line 15-23, try moving the isBlueSpawned = true somewhere up
Well I tried to move it in between every line after wait, nothing changed. Ty for trying though