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

Why is this not working?

Asked by 10 years ago

Weird D:

local function onClick()
    script.Parent.Parent:TweenPosition(UDim2.new(0,0,1,0))
    wait(0.1)
    script.Parent.Parent.Parent.TextLabel:TweenPosition(UDim2.new(0.5,0,0.9,0))
    wait(0.2)
    script.Parent.Parent.Parent.TeamService:TweenPosition(UDim2.new(0.24,0,0.2,0))
    if game.Players.LocalPlayer.TeamColor == BrickColor.new("Bright violet") then
        script.Parent.Parent.Parent.TeamService.Americans.Visible = false
        script.Parent.Parent.Parent.TeamService.SS.Visible = false
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = false
        script.Parent.Parent.Parent.TeamService.President.Visible =     false
        script.Parent.Parent.Parent.TeamService.VP.Visible = false
        script.Parent.Parent.Parent.TeamService.SecretaryState.Visible = false
        script.Parent.Parent.Parent.TeamService.Founder.Visible = false
        script.Parent.Parent.Parent.TeamService.Congress.Visible = false
        script.Parent.Parent.Parent.TeamService.Cabinet.Visible = false
        script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = false
        script.Parent.Parent.Parent.TeamService.SWAT.Visible = false
        script.Parent.Parent.Parent.TeamService.USCP.Visible = false
        script.Parent.Parent.Parent.TeamService.DOJ.Visible = false
        script.Parent.Parent.Parent.TeamService.HLS.Visible = false
        script.Parent.Parent.Parent.TeamService.MService.Visible = false
        return  
    end
    if game.Players.LocalPlayer.Name == ("Player1") or game.Players.LocalPlayer.Name == ("TGSCommander") or game.Players.LocalPlayer.Name == ("QueenWHood") then
        script.Parent.Parent.Parent.TeamService.Americans.Visible = true
        script.Parent.Parent.Parent.TeamService.SS.Visible = true
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
        script.Parent.Parent.Parent.TeamService.President.Visible =     true
        script.Parent.Parent.Parent.TeamService.VP.Visible = true
        script.Parent.Parent.Parent.TeamService.Founder.Visible = true  
        script.Parent.Parent.Parent.TeamService.Congress.Visible = true
        script.Parent.Parent.Parent.TeamService.Cabinet.Visible = true
        script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = true
        script.Parent.Parent.Parent.TeamService.SWAT.Visible = true
        script.Parent.Parent.Parent.TeamService.USCP.Visible = true
        script.Parent.Parent.Parent.TeamService.DOJ.Visible = true
        script.Parent.Parent.Parent.TeamService.HLS.Visible = true
        script.Parent.Parent.Parent.TeamService.MService.Visible = true
    end
    if game.Players.LocalPlayer.Name == ("mission85") then
        script.Parent.Parent.Parent.TeamService.SecretaryState.Visible = true
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
    end
    if game.Players.LocalPlayer.Name == ("USMNews1") then
        script.Parent.Parent.Parent.TeamService.President.Visible = true
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
        script.Parent.Parent.Parent.TeamService.SS.Visible = true
        script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = true
        script.Parent.Parent.Parent.TeamService.SWAT.Visible = true
        script.Parent.Parent.Parent.TeamService.USCP.Visible = true
        script.Parent.Parent.Parent.TeamService.DOJ.Visible = true
        script.Parent.Parent.Parent.TeamService.HLS.Visible = true
        script.Parent.Parent.Parent.TeamService.MService.Visible = true
    end
    if game.Players.LocalPlayer.Name == ("McReli") then
        script.Parent.Parent.Parent.TeamService.VP.Visible = true
        script.Parent.Parent.Parent.TeamService.SS.Visible = true
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
        script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = true
        script.Parent.Parent.Parent.TeamService.SWAT.Visible = true
        script.Parent.Parent.Parent.TeamService.USCP.Visible = true
        script.Parent.Parent.Parent.TeamService.DOJ.Visible = true
        script.Parent.Parent.Parent.TeamService.HLS.Visible = true
        script.Parent.Parent.Parent.TeamService.MService.Visible = true
    end
    if game.Players.LocalPlayer.Name == ("iRnitrez") or game.Players.LocalPlayer.Name == ("mission85") then
        script.Parent.Parent.Parent.TeamService.Cabinet.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1181092) then
        script.Parent.Parent.Parent.TeamService.Americans.Visible = true
    end
    if game.Player.LocalPlayer:IsInGroup(1214465) then
        script.Parent.Parent.Parent.TeamService.SS.Visible = true
    end
    if game.Players.Localplayer:IsInGroup(1214432) then
        script.Parent.Parent.Parent.TeamService.StateDept.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1214694) then
        script.Parent.Parent.Parent.TeamService.Congress.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1215144) then
        script.Parent.Parent.Parent.TeamService.DefenseDept.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1215148) then
        script.Parent.Parent.Parent.TeamService.SWAT.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1215145) then
        script.Parent.Parent.Parent.TeamService.USCP.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1215003) then
        script.Parent.Parent.Parent.TeamService.DOJ.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1218846) then
        script.Parent.Parent.Parent.TeamService.HLS.Visible = true
    end
    if game.Players.LocalPlayer:IsInGroup(1213695) then
        script.Parent.Parent.Parent.TeamService.MService.Visible = true
    end
end


script.Parent.MouseButton1Down:connect(onClick)
1
Do you have any errors when you run this? Where is it? What kind of script is it? We need more info! Bman8765 270 — 10y
0
A team script from a button. I did not get a error. A local script. It's in a button. TGSCommander 0 — 10y

Answer this question