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

Can anyone help me edit this?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

legobuildermaster helped me out with this script but know I want to take it one step further... In this script, while the brick is red, what ever it in " -- Your code stuffz goes here!" and will happen.

local brick = workspace.brick

function loopityLoop()
    while brick.BrickColor = BrickColor.Red() do -- The loop that will run until "brick.BrickColor" isn't red anymore! (Also "BrickColor.Red()" is the bright red color!)
    -- Your code stuffz goes here!
    wait() -- Used so studio nor Roblox will crash!
    end
end

brick.Changed:connect(loopityLoop) 

(I really don't wanna say this but)What I want to happen is that while a brick is red, you can click e to do an animation. If you click e than a different brick will turn white. But after you click e the same brick will turn green. So this is what I came up with:

local brick = workspace.brick

function loopityLoop()
    while brick.BrickColor = BrickColor.Red() do -- The loop that will run until "brick.BrickColor" isn't red anymore! (Also "BrickColor.Red()" is the bright red color!)

game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
    if string.lower(key) ==  "q" then


local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" 

local animTrack = Humanoid:LoadAnimation(animation)  
animTrack:Play()


    end
end)


    wait() -- Used so studio nor Roblox will crash!
    end
end

brick.Changed:connect(loopityLoop)

game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
    if string.lower(key) ==  "q" then
brick.BrickColor = BrickColor.Red()
local b2 = workspace.b2
  b2 BrickColor = BrickColor.White()

Please edit. Also tell me whats wrong with it so I can learn :/

0
Opps, forgot you can't use numbers in a local! salmonbear242 50 — 8y

Answer this question