I've been editing and messing with a slime game recently. This is the script that creates the "IsSlime" object. I would like to make a gui, that when clicked asks if they would like to reset (remove) their current slime. I have no idea where to start.
(Create script.)
while true do
wait(1)
if script.Parent.Debounce.Value == true then
local Name = script.Parent.Turner.Value
local W = game.Workspace:GetChildren()
local HasSlime = false
for i = 1, #W do
if W[i]:findFirstChild("IsSlime") ~= nil then
if W[i].Owner.Value == Name then
HasSlime = true
end
end
end
if HasSlime == false then
script.Parent.Motor.BottomSurfaceInput = "Constant"
wait(0.5)
local Slime = game.Lighting["No-name"]:clone()
Slime.Owner.Value = Name
Slime.Head.CFrame = CFrame.new(script.Parent.Parent.Faucet.Spout.Position) * CFrame.new(0, -1, 0)
Slime.Head.Velocity = Vector3.new(0, 0, 0)
Slime.Parent = game.Workspace
Slime.Head.BrickColor = BrickColor.Random()
Slime.Humanoid.MaxHealth = 10
Slime.Humanoid.Health = 10
local materials = {"Plastic", "Brick", "Cobblestone", "Concrete", "CorrodedMetal", "DiamondPlate", "Fabric", "Foil", "Granite", "Grass", "Ice", "Marble", "Metal", "Pebble", "Sand", "Slate", "SmoothPlastic", "Wood", "WoodPlanks"}
local matpick = math.random(1, 19)
Slime.Head.Material = materials[matpick]
local Chance = math.random(1, 20)
if Chance == 20 then
Slime.Head.Reflectance = 0.4
Slime.Material = "Plastic"
end
if game.Players:findFirstChild(script.Parent.Turner.Value) ~= nil then
if game.Players:findFirstChild(script.Parent.Turner.Value):IsInGroup(467010) == true then
local M = Instance.new("Model")
M.Name = "VIP"
M.Parent = Slime
end
end
game.Lighting.PlantTip:clone().Parent = game.Players:findFirstChild(script.Parent.Turner.Value).PlayerGui
wait(1)
script.Parent.Motor.BottomSurfaceInput = "NoInput"
end
script.Parent.Debounce.Value = false
end
end

4 comments
@TheAlphaStigma , lol you deleted your comment, you didn't read that one part. Also, what was that question about the delete doesn't work thing.
I know. :P I noticed that right after I posted my comment, so I removed it because it was Off-Topic from your answer. Also, I don't remember anything about me mentioning Deleting (from my last comment, that is). o_e
Nit: Part:Remove() isn't the same thing as Part.Parent = nil -- it also :Remove()s all of its children
I thought that would of been obvious :\