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

When I click this button, nothing is working. A little help?

Asked by 5 years ago
local podium1 = game.Workspace.podium1
local button = script.Parent
local debounce = true 

button.MouseButton1Click:Connect(function()
    if debounce == true then
        debounce=false
        for i = 0,.15,.001 do
            podium1:SetPrimaryPartCFrame(podium1:GetPrimaryPartCFrame()* CFrame.new(i,0,0))
            wait()
            podium1.bottomlight.SurfaceLight.Color = Color3.new(.745098, 0.407843, 0.384314)
            podium1.bottomlight.Smoke.Color = Color3.new(.745098, 0.407843, 0.384314)

    else
        debounce=true
        for i = 0, .15, 001 do
            podium1:SetPrimaryPartCFrame(podium1:GetPrimaryPartCFrame()* CFrame.new(-i,0,0))
            wait()
            podium1.bottomlight.SurfaceLight.Color = Color3.new(0.972549, 0.972549, 0.972549)
            podium1.bottomlight.Smoke.Color = Color3.new(0.972549, 0.972549, 0.972549) 
        end
    end
end)

Basically, I'm trying to make this thing wherein you click this button (a textbutton), and it makes this podium move, stop and its smoke and surface light becomes red. Afterwards, when I click the textbutton again, it goes back to its original position and the colors of the surfacelight and the smoke turn blue. The thing is, when I click the button, nothing is happening. A little help?

0
So second for loop, looks like you have the increment value set to "001", so all you need to do is set it to ".001" SteamG00B 1633 — 5y
0
Also, are you able to put a space between the "==" in an if statement? I've never seen anyone do that before. SteamG00B 1633 — 5y
0
Thanks! That helped. Also, I forgot to place an end for the first for loop too, Thank you though. lightdukez125 18 — 5y

Answer this question