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

Halp me please?

Asked by 10 years ago
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

Log in to vote
0
Answered by 10 years ago

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
Ad
Log in to vote
-1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago
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. 
Log in to vote
-2
Answered by
KAAK82 16
10 years ago

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...

0
Confusing... Perci1 4988 — 10y
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... KAAK82 16 — 10y

Answer this question