Hey all, I'm trying to make a script that turns on and off a GUI that is located in the Torso of a player's character. This is what I have so far.
Local Script:
local RS = game:GetService('ReplicatedStorage')
local rEvent = RS:FindFirstChild('metaOnEvent')
local rEventOff = RS:FindFirstChild('metaOffEvent')
local meta = false
local debounce = false
local reset_Secs = 2
script.Parent.MouseButton1Down:Connect(function()
if not meta then
if debounce then return end
debounce = true
--rEvent:FireServer()
--[[Start of newly implemented]]--
local Players = game.Players:GetPlayers()
for _,v in pairs(Players) do
v.Character.HumanoidRootPart.metaGUI.Enabled = true
end
game.Players.LocalPlayer.Character.HumanoidRootPart.metaGUI.Enabled = false
--[[End of newly implemented]]--
wait(reset_Secs)
debounce = false
else
meta = false
--rEventOff:FireServer()
--[[Start of newly implemeted]]--
local plrs= game.Players:GetPlayers()
for _,v in pairs(plrs) do
v.Character.HumanoidRootPart.metaGUI.Enabled = false
end
--[[End of newly implemented]]--
end
end)
But, after a player turns them on, they cannot be turn off again! Are there any solutions you guys can think up?
