local Folder = game.StarterGui.ScreenGui.Frame:WaitForChild("Folder"):GetChildren()
local randomize = Folder[math.random(1,#Folder)]
local frame = game.StarterGui.ScreenGui.Frame.Folder:WaitForChild(randomize.Name)
local frame2 = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
ReplicatedStorage.TouchedGUIPart.OnClientEvent:Connect(function(visibility)
frame.Visible = visibility
end)
ReplicatedStorage.TouchedGUIPart.OnClientEvent:Connect(function(visibility)
frame2.Visible = visibility
end)
local Players = game:GetService("Players")
local part = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
part.Touched:Connect(function(otherPart)
local player = Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
ReplicatedStorage.TouchedGUIPart:FireClient(player, true)
end
end)
part.TouchEnded:Connect(function(otherPart)
local player = Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
ReplicatedStorage.TouchedGUIPart:FireClient(player, false)
end
end)










0 comments