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

Image won't go at 0 transparency?

Asked by 4 years ago
Edited 4 years ago

https://gyazo.com/34fb2392f8a7fe5de60db616e7b74bc6 In this gif I first click on the purple logo, and then when I click on the red logo the purple logo is supposed to go at 0 transparency.

Here is the code:

01local StartingScreen = script.Parent
02local ParthiaButton = StartingScreen.MainFrame.Parthia
03local player = game.Players.LocalPlayer
04local TeamInform = StartingScreen.MainFrame.TeamInform
05local RomeButton = StartingScreen.MainFrame.Rome
06StartingScreen.Enabled = true
07 
08ParthiaButton.MouseButton1Click:Connect(function()
09    print("Assigned team to Parthia")
10    player.Team = game.Teams.Parthia
11    ParthiaButton.ImageTransparency = 0.6
12    TeamInform:TweenPosition(UDim2.new(0.4, 0,0.6, 0),"Out","Bounce",3)
13    TeamInform.Text = "Your team is the Parthian Empire!"
14    if player.Team == game.Teams.Rome then
15        RomeButton.ImageTransparency = 0
View all 29 lines...

Here is the explorer https://gyazo.com/08a3ea82f08e1957fd5d5516caff9ea8

In the properties tab of the image transparency it doesn't change at all when I click on each logo. Does anyone know why?

(I had a third logo and it worked perfectly. I recently team shared and deleted the third logo. Every since I did it does not work. The output shows nothing also.)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I Discovered the problem, You changed the team before checking if its team is the other team, So it wont detect if the other gui is transparent, I changed 2 lines of your code and it resolved the problem

01local StartingScreen = script.Parent
02local ParthiaButton = StartingScreen.MainFrame.Parthia
03local player = game.Players.LocalPlayer
04local TeamInform = StartingScreen.MainFrame.TeamInform
05local RomeButton = StartingScreen.MainFrame.Rome
06StartingScreen.Enabled = true
07 
08ParthiaButton.MouseButton1Click:Connect(function()
09    print("Assigned team to Parthia")
10    ParthiaButton.ImageTransparency = 0.6
11    TeamInform:TweenPosition(UDim2.new(0.4, 0,0.6, 0),"Out","Bounce",3)
12    TeamInform.Text = "Your team is the Parthian Empire!"
13    if player.Team == game.Teams.Rome then
14        RomeButton.ImageTransparency = 0
15        end
View all 27 lines...

player.Team = game.Teams.Rome end)

0
Thanks! This really helped. iiDevPanda 43 — 4y
Ad

Answer this question