Hi,
Thanks for getting back to me. I have got the full script here which I have added your code into it - the main bit of the script like "Please wait.." works fine, but I have tested this when there is no ball on the Workspace and there is a problem which is that the light of the button has not been changed and the text has not changed either. So, I am just wondering if I might've put in the wrong place or do you think I have added something extra which it wont work.
Anyways, here is the full code.
function onClicked()
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.BrickColor = BrickColor.new (21)
m = script.Parent.Parent.Ball1:Clone()
m.Parent = game.Workspace
m.Handle.CanCollide = true
m.Handle.Anchored = false
m.Handle.Transparency = 0
m.Enabled = true
script.Parent.SurfaceGui.TextLabel.Text = "Please wait."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait.."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait..."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait.."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait..."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text = "Please wait.."
wait(1)
script.Parent.SurfaceGui.TextLabel.Text= "Regen Ball"
script.Parent.ClickDetector.MaxActivationDistance = 30
script.Parent.BrickColor = BrickColor.new (28)
if game.Workspace.FindFirstChild("Ball1") then
script.Parent.SurfaceGui.TextLabel.Text = "Out of use!"
script.Parent.BrickColor = BrickColor.new (21)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
1 comment
FYI: the way you did it (If Hierarchy is right) would only work IF that Ball2 existed.