I think I know what to do: local t = script.Parent
script.Parent.MouseButton1Click:Connect(function()
for i = 1,100 do
t.BackgroundTransparency -= 0.01 --- u put ImageTransparency
wait(0.01)
end
end)
I think I know what to do: local t = script.Parent
script.Parent.MouseButton1Click:Connect(function()
for i = 1,100 do
t.BackgroundTransparency -= 0.01 --- u put ImageTransparency
wait(0.01)
end
end)
idk how to make it fade in again
don’t listen to me I am in experienced
Don’t worry. An experienced scripter is here
I have several questions:
Are you making it so that one player activates it and then everyone sees it?
Can we see the explorer hierarchy for it? I need to know what is what.
Are you aware of tweenservice?
idk how to make the whole server see it sadly
I changed the script, this is the new one.
So basically before i send the script, here’s where everything is:
This is the script inside a button
And this is the button in the game:
This is the Image i want to display
And this is it in the explorer tab
local GUI = script.Parent.Parent
local plr = game.Players.LocalPlayer
local Image = game.StarterGui.UpdateGUI.PathChosen
local function FadeIn()
for i = 1, 0, -0.02 do
wait(0.02)
Image.ImageTransparency = i
end
Image.ImageTransparency = 0
end
local function FadeOut()
for i = 0, 1, -0.02 do
wait(0.02)
Image.ImageTransparency = i
end
Image.ImageTransparency = 1
end
script.Parent.MouseButton1Click:Connect(function()
FadeIn()
wait(5)
FadeOut()
end)
and also with the new script i don’t want to make it so that when clicked again it fades out, I want to make it so that when it’s clicked once, it fades in, waits 5 seconds then fades out
Hey! Yeah i’m trying to make it so that one person clicks on it and the whole server sees it but I got a script that makes it so that the button is only seen by a specific role.
I posted everything related to the script in a response to sufty’s message!
hmmm to make the whole server see it I can’t help u but to make it fade I can help
Also i forgot to answer the third question, I know what tweenservice is i just don’t know how to use it because it’s complicated
First thing first, put the “Path Chosen” image inside of replicated storage instead of starter gui. Put it as a direct child of replicated storage. Next, make 2 remote events,1 called “PathChosenEvent” and the other called “DisplayImageEvent” put them inside replicated storage as well.
local TweenService = game:GetService("TweenService")
local MainFrame = script.Parent.Parent.Parent
local StoryUpdates = MainFrame.Parent
local Image = game.ReplicatedStorage.PathChosen:Clone()
Image.Parent = StoryUpdates.Parent.UpdateGUI
Image.BackgroundTransparency = 1
local PathChosenEvent = game.ReplicatedStorage.PathChosenEvent
local DisplayImageEvent = game.ReplicatedStorage.DisplayImageEvent
script.Parent.Activated:Connect(function()
PathChosenEvent:FireServer()
end)
DisplayImageEvent.OnClientEvent:Connect(function()
local tweeninfo = TweenInfo.new(1)
local tween = TweenService:Create(Image,tweeninfo,{BackgroundTransparency = 0})
tween:Play()
tween.Completed:Connect(function()
tween:Destroy()
end)
task.wait(5)
local tween2 = TweenService:Create(Image,tweeninfo,{BackgroundTransparency = 1})
tween2:Play()
tween2.Completed:Connect(function()
tween2:Destroy()
end)
end)
---------SERVER SCRIPT
local PathChosenEvent = game.ReplicatedStorage.PathChosenEvent
local DisplayImageEvent = game.ReplicatedStorage.DisplayImageEvent
PathChosenEvent.OnServerEvent:Connect(function(player)
local valid = true
--check if the player is the person who's supposed to activate the button.
--if its not, set valid to be false
--also do more sanity checks as neccesary
if valid then
DisplayImageEvent:FireAllClients()
end
end)
For everything under “Server Script” put them in a server script somewhere.
It works! But it shows as a blank frame and not an image for some reason
nvm i fixed it thank you so much for your help!! i really appreciate it
Sorry I couldn’t help I’m glad it works though!
It’s alright! i appreciate your help dw
I tried testing it with a friend, it showed up for them because they were the owners but ti didn’t for me which is weird
I am not sure if you can do that with UI so maybe that Is the case.
Nvm i didn’t notice that I had to change the player name
Ohh alright hah there is your problem solved !
oh yeah swapilla? are you in a group project?