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

Why does this simple Image transparency changer script only work in studio?

Asked by
PastDays 108
5 years ago
local Debounce = true
script.Parent.MouseButton1Click:connect(function()
    if Debounce == true then Debounce = false
        if script.Parent.Parent.PlanetView.ImageTransparency == 0 then
            script.Parent.Parent.PlanetView.ImageTransparency = 1
            script.Parent.Parent.StatsView.ImageTransparency = 0
        else if script.Parent.Parent.PlanetView.ImageTransparency == 1 then
            script.Parent.Parent.PlanetView.ImageTransparency = 0
            script.Parent.Parent.StatsView.ImageTransparency = 1
        end
    end
        Debounce = true
    end
end)
0
This is because you're editing the image in the StarterGui Instead, Use Player.PlayerGui.[ScreenGui name]['Imagename'].ImageTransparency mixgingengerina10 223 — 5y
0
Actually, that does the same thing. ieatandisbaconhair 77 — 5y
0
The script is in the GUI so it is locating the image from inside the GUI so that can't be the problem PastDays 108 — 5y
0
Because you're using a SERVER script, use a LOCAL script. Always use these for guis. User#19524 175 — 5y
0
Absolute face palm, I haven't played roblox in a month so i guess thats what i get. PastDays 108 — 5y

Answer this question