Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Halp me please?

BackgroundTransparency = script.Parent.Parent.Background.BackgroundTransparency
function Click() -- after the arrow was clicked V happens
	script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-94.6, 36.8, -16.5) -- teleports player
script.Parent.Parent.Background.BackgroundTransparency = BackgroundTransparency -0.1-- problem is here it only works once :/ can you make it work twice?
wait(0.1) -- wait 0.1
end -- ends script
script.Parent.MouseButton1Down:connect(Click) -- connects function to script

3 answers

1 thing the variable for the gui is missing

gui= script.Parent-- you are missing the whole variable 
gui.BackgroundTransparency = script.Parent.Parent.Background.BackgroundTransparency
function Click() -- after the arrow was clicked V happens
    script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-94.6, 36.8, -16.5) -- teleports player
script.Parent.Parent.Background.BackgroundTransparency = gui.BackgroundTransparency -0.1
wait(0.1) -- wait 0.1
end -- ends script
script.Parent.MouseButton1Down:connect(Click) -- connects function to script
script.Parent.Parent.Background.BackgroundTransparency --This is a number, and will always remain the same number, unless you update the varible later in the script.

Let's say BackgroundTransparency is equal to 1.

script.Parent.Parent.Background.BackgroundTransparency = gui.BackgroundTransparency -0.1

1 - 0.1 = 0.9, so it will make the gui a little more transparent.

Now, the gui's BackgroundTransparency is 0.9, but the variable you made named 'BackgroundTranspareny' still equals 1!

Therefore, each time you click it sets the gui's BackgroundTransparency to 0.9.

To fix this, just do the following:

script.Parent.Parent.Background.BackgroundTransparency = script.Parent.Parent.Background.BackgroundTransparency - 0.1 --Subtracts 0.1 from the transparency every time you click. 

about the Transparency if ya mean to do 2'ice then just add in another one that is lalala.Transparency -01 and also, for Teleporting, dont do the Torso, do the Character cos it just does the Torso not the Hole Body...

2 comments

0

Confusing...

0

Perci... did u just Thumbs Don on me??? u could ask nicely! am no Dog to be Controlled by, I help but I follo my Rules not anyone elses... so next time, if u see something confusing, say it to my Face...

This discussion is preserved as it was. New answers, comments, and votes are closed.