Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add coins and powers to my game?(and that if you leave 4 glass walls you get coins for it

Asked by 2 years ago

Please tell me what scripts u need if that here is not enough.

-replicated storage -ball -click detector -script:

local c = script.Parent local b = c.Parent

function Destroy() b:Destroy() end

c.MouseClick:Connect(Destroy)

-,,Generator" (round part) -script:

local r = game.ReplicatedStorage local b = r:WaitForChild("Ball") local g = script.Parent

local n local s local c local x local y

function Generate()

01n = b:Clone()
02 
03s=math.random(4,40)
04n.Size = Vector3.new(s,s,s)
05x = math.random(-10,10)
06y = math.random(-10,10)
07n.Position = g.Position + Vector3.new(x,0,y)
08n.Parent = g
09n.BrickColor = BrickColor.random()
10 
11wait (0.2)

end

while true do

01c = 100
02 
03wait(10)
04 
05print("New Game!")
06 
07for i = 1, 40,1 do
08    Generate()
09end
10for i = 1, 100,1 do
11    Generate()
12    wait(1)
13    c = c - 1
14    print ("Pozosta?o"..c.."s")
15end
16print ("Time ended!")
17 
18g:ClearAllChildren()
19end

Answer this question