my script here is:
01 | local debouce = false |
02 | local gui = game.ReplicatedStorage.EasyGUI |
03 | local frame = gui.Frame |
04 |
05 | local function onTouched(hit) |
06 | if not debouce then |
07 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
08 | if player then |
09 | if player.PlayerGui:FindFirstChild( "EasyGUI" ) = = nil then |
10 | debounce = true |
11 | local clone = gui:Clone() |
12 | local gui 2 = clone |
13 | local frame 2 = gui 2. Parent.Frame |
14 | clone.Parent = player.PlayerGui |
15 | frame 2. Transparency = 1 |
thank you,
-Dexiber
The problem is in
1 | local clone = gui:Clone() |
2 | local gui 2 = clone |
3 | local frame 2 = gui 2. Parent.Frame |
When you clone something, it exists only in memory until you define its parent. Do this:
1 | local clone = gui:Clone() |
2 | clone.Parent = gui.Parent |
3 | local gui 2 = clone |
4 | local frame 2 = gui 2. Parent.Frame |
and that can be simplified to
1 | local gui 2 = gui:Clone() |
2 | gui 2. Parent = gui.Parent |
3 | local frame 2 = gui 2. Parent.Frame |
And for your transparency list, you can use a simple for loop:
1 | for i = 1 , 0 , - 0.1 do |
2 | frame 2. Transparency = i |
3 | wait( 0.5 ) |
4 | end |
5 |
6 | for i = 0 , 1 , 0.1 do |
7 | frame 2. Transparency = i |
8 | wait( 0.5 ) |
9 | end |