Back again! I am trying to get my custom GUI to show up on screen when triggered by the ProximityPrompt. I have 2 scripts:
Handler:
-- Variables
local HuntScreen = game.ReplicatedStorage.HuntScreen
local Screen = script.Parent.Parent.ScreenGui.ImageLabel
local ViewTime = 70
-- Mains
HuntScreen.OnClientEvent:Connect(function() -- When Client fires, this will response
for i = 1,10 do
Screen.ImageTransparency -= 0.1
wait(0.01) -- 0.01 more faster fade or 0.1 slow fade
end
wait(ViewTime)
for i = 1,10 do
Screen.ImageTransparency += 0.1
wait(0.01)
end
end) -- End
Then the executer I had this so far (This is inside of the ProximityPrompt):
1- The parameter ’ screen’ is not the UI, but the Player who triggered the prompt.
2-You can use a remote, but I don’t think it’s necessary here,
instead - you could clone the UI into that player from the server, and do the stuff too.
script.Parent.Triggered:Connect(function(Player)
local UI = script.Parent["YOUR_GUINAME"]:Clone()
UI.Parent = Player:WaitForChild("PlayerGui")
--Get access to the frame/button here
end)
script.Parent.Triggered:Connect(function(Player)
local UI = script.Parent["YOUR_GUINAME"]:Clone()
UI.Parent = Player:WaitForChild("PlayerGui")
--Get access to the frame/button here
task.wait(1) -- change 1 to whatever you want
UI:Destroy() --destroys the UI
end)