Hello, currently, I am making a game where if the round ends, your blocks destroy. However, the blocks simply just stay there! It does not destroy. I really don’t know what’s happening. Can someone help?
Here’s a picture:
The purple blocks are supposed to destroy when there is no map, as you can see the map destroys, but the blocks don’t.
Here is my script:
Status.Value = "End of game!"
task.wait(2)
for i,player in pairs(game.Players:GetPlayers()) do
local charac = player.Character
if not charac then
print("Player does not have character!")
elseif charac then
if charac:FindFirstChild("GameTag") then
charac.GameTag:Destroy()
player:LoadCharacter()
end
end
end
for i,v in pairs(workspace.StepsFolder:GetChildren()) do
if v.Name == "Step" then
v:Destroy()
end
end
ClonedMap:Destroy()
workspace.Lobby.Construction.SurfaceGui.TextLabel.Text = "0"
workspace.Lobby.Radioactive.SurfaceGui.TextLabel.Text = "0"
workspace.Lobby.City.SurfaceGui.TextLabel.Text = "0"
Timer.Value = 180
task.wait(3)
--END OF GAME ENDING
local cl = script:Clone()
cl.Parent = script.Parent
script:Destroy()
And in the output, there is an error in this script below this line (the drop down thing):
Script
local Status = game.ReplicatedStorage.Status
local data = require(game.ReplicatedStorage["Questions/Answers"])
local Question = Status.Value
local StepsFolder = workspace.StepsFolder
local plrs = {}
local MS = game:GetService("MarketplaceService")
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Whitelist
StepsFolder.DescendantAdded:Connect(function(desc)
if type(desc) == type(Instance.new('Part')) then
end
end)
local label = Instance.new('SurfaceGui')
label.PixelsPerStud = 40
local alab = Instance.new('TextLabel')
alab.TextSize = 70
alab.BackgroundTransparency = 1
alab.TextStrokeTransparency = 0
alab.Font = Enum.Font.FredokaOne
alab.TextStrokeColor3 = Color3.new(0,0,0)
alab.TextColor3 = Color3.new(1,1,1)
alab.Size = UDim2.new(1,0,1,0)
alab.TextTransparency = 1
local function CheckAnswer(player,answer)
local answer = string.lower(answer)
warn(player,answer,data[Status.Value])
local colo = Color3.fromHSV(Random.new(time()):NextNumber(),1,1)
for _, x in pairs(data[Status.Value].answers) do
if answer == string.lower(x) then
print(answer.."True")
local sound = script.AnsweredSound:Clone()
sound.Parent = player.PlayerGui
sound:Play()
local length = #answer
for i = 1,length do
task.wait(0.1)
sound:Play()
player.leaderstats.Letters.Value += if MS:UserOwnsGamePassAsync(player.UserId, 106358664) then 2 else 1
local step = Instance.new("Part")
step.Parent = StepsFolder
step.Anchored = true
step.Color = colo --Color3.new(0.901961, 1, 0.576471)
step.Name = "Step"
step.Transparency = 1
step.Size = Vector3.new(5,1,5)
params.FilterDescendantsInstances = {StepsFolder,workspace.Game}
local rayres = workspace:Raycast(player.Character:FindFirstChild("HumanoidRootPart").Position,Vector3.new(0,-8,0),params)
step.CFrame = rayres.Instance.CFrame + Vector3.new(0,1,0)
if 1 ~= 2 then
local cl1 = label:Clone()
cl1.Parent = step
cl1.Face = Enum.NormalId.Front
local cl2 = alab:Clone()
cl2.Parent = cl1
cl2.Text = string.sub(string.upper(answer),i,i)
cl1 = label:Clone()
cl1.Parent = step
cl1.Face = Enum.NormalId.Back
cl2 = alab:Clone()
cl2.Parent = cl1
cl2.Text = string.sub(string.upper(answer),i,i)
cl1 = label:Clone()
cl1.Parent = step
cl1.Face = Enum.NormalId.Right
cl2 = alab:Clone()
cl2.Parent = cl1
cl2.Text = string.sub(string.upper(answer),i,i)
cl1 = label:Clone()
cl1.Parent = step
cl1.Face = Enum.NormalId.Left
cl2 = alab:Clone()
cl2.Parent = cl1
cl2.Text = string.sub(string.upper(answer),i,i)
end
if player.SPEC.Value ~= 'nully' then
local deca = Instance.new('Decal')
deca.Texture = player.SPEC.Value
deca.Parent = step
deca.Face = Enum.NormalId.Front
deca = deca:Clone()
deca.Parent = step
deca.Face = Enum.NormalId.Back
deca = deca:Clone()
deca.Parent = step
deca.Face = Enum.NormalId.Right
deca = deca:Clone()
deca.Parent = step
deca.Face = Enum.NormalId.Left
deca = deca:Clone()
deca.Parent = step
deca.Face = Enum.NormalId.Top
deca = deca:Clone()
deca.Parent = step
deca.Face = Enum.NormalId.Bottom
end
task.delay(5,function() for _,v in pairs(step:GetChildren()) do v.TextLabel.TextTransparency=0 end end)
end
if MS:UserOwnsGamePassAsync(player.UserId, 106358664) then --X2 Letters
game.ReplicatedStorage.TweenTransparency:FireClient(player,length*2)
else
game.ReplicatedStorage.TweenTransparency:FireClient(player,length)
break
end
end
end
end
game.ReplicatedStorage.SendAnswer.OnServerEvent:Connect(function(player,answer)
print('checking')
CheckAnswer(player,answer)
end)
If you open that up, it says in output:
Sorry if this was a bit long!! But I honestly couldn’t fix these problems. You don’t have to fix all of em, just one of them will do. Thanks!