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

Script Doesnt Change Transparency Of PlayerGui Then Kick Player?

Asked by 1 year ago

again idk what to title this

what this script is supposed to do is it'll get the player added, and it will detect the value of the second value, if the value is below 10, it will slowly make the sound in Workspace louder and will slowly change the transparency in PlayerGui, if the value is above 10 it will change the volume of the sound to 0 and make the ImageLabel transparent, once the second value reaches 0, it will kick the player

the script was working before, but i had done some editing once and now it just doesn't work. the seconds tick down correctly, everything else is fine but this script doesn't work

(the script is supposed to kick everyone in the server when the value reaches 0, also the script is set on legacy if that has a thing to do with the script not working)

Script

local seconds = script.Parent.Second

game.Players.PlayerAdded:Connect(function(plr)
    while task.wait(0.1) do
        if seconds.Value < 10 then
            plr.PlayerGui.Static.ImageLabel.ImageTransparency -= 0.01
            workspace.Static:Play()
            workspace.Static.Volume += 0.1
        end
        if seconds.Value <= 0 then
            plr:Kick("How Odd? I Cant Find Anything Related To This In The Explorer, A Static Figure...")
        end
        if seconds.Value > 10 then
            workspace.Static:Stop()
            workspace.Static.Volume = 0
            plr.PlayerGui.Static.ImageLabel.ImageTransparency = 1
        end
    end
end)

Answer this question