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

How to fix my script for owner detection and gui fading?

Asked by 2 years ago
Edited 2 years ago

The script now works in a way, It does part of what I want but I have another frame in the GUI that I also want faded, I can't put the script in both frames because it only works for the second one for some reason, I also need to change the text transparency of text labels that are children of the frames, using the same script but with text transparency won't work at all.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

local TweenService = game:GetService('TweenService')
local function guitween()

    wait(7)
    TweenService:Create( script.Parent, TweenInfo.new(2), {BackgroundTransparency = 1}):Play()
end

RemoteEvent.OnClientEvent:Connect(guitween)
0
you didnt even put any code to receive the remote call!! sne_123456 439 — 2y

1 answer

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

Hi its not working because you didnt put in any code to receive the remote event call, therefore, the remote event cannot reach to the local script.

There are also many things that you have to do!

1st you must put all your code in the localscript into a function so it can all run when the remote call is received.

Heres what it should look like!

local TweenService = game:GetService('TweenService')

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

local function guitween()

 wait(2)
 TweenService:Create( Parent.Frame, TweenInfo.new(2), {BackgroundTransparency = 1}):Play()
end

remoteEvent.OnClientEvent:Connect(guitween)

Hope this helps!

Any questions? Just ask!

0
Haha, I'm only new to scripting which is probably quite clear. This didn't seem to work, it must be something in my eventfire script then? CheeseBallGuy11 12 — 2y
Ad

Answer this question