You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want it to destroy the clone frame my part makes when you click on the part -
What is the issue? Include screenshots / videos if possible!
I’m having an issue with my mopping server script when I add the part that is supposed to destroy the clone frame it breaks my mopping server script
here’s my moppin server script
local SpillLocationsFolder = game.Workspace.SpillLocations
local SpillLocations = SpillLocationsFolder:GetChildren()
local function DestroyFrame(player)
local mainFrame = player.PlayerGui:WaitForChild("MainFrame")
local scrollingFrame = mainFrame:WaitForChild("StartFrame"):WaitForChild("JobsHolder"):WaitForChild("ScrollingFrame")
for _, frame in pairs(scrollingFrame:GetChildren()) do
if frame:IsA("Frame") and frame.Name == "Job" and frame.Visible then
frame:Destroy()
break
end
end
end
for i = 1, #SpillLocations do
local Spill = SpillLocations[i]
local MopSpillEvent = Spill.MopSpill
MopSpillEvent.OnServerEvent:Connect(function(Player)
print("Cleaning Spill")
local Tween = TweenService:Create(Spill, TweenInfo.new(5), {Size = Vector3.new(0, 0, 0)})
Tween:Play()
wait(5)
Spill.Transparency = 1
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value + 1
DestroyFrame(Player)
end)
end
while true do
local RandomSpill = SpillLocations[math.random(1, #SpillLocations)]
RandomSpill.Transparency = 0
RandomSpill.BrickColor = BrickColor.Random()
RandomSpill.Size = Vector3.new(0.1, 4.4, 4.65)
wait(60)
end