Hi, for some reason my gui wont open.
Server Script:
event = RS:WaitForChild("MenuUI")
event.OnServerEvent:Connect(function(player, val)
print("event fired")
print(val) -- prints nil
if val == true then
player:WaitForChild("PlayerGui"):WaitForChild("Menu"):WaitForChild("Value").Value = true
else
player:WaitForChild("PlayerGui"):WaitForChild("Menu"):WaitForChild("Value").Value = false
end
end)```
Gui client script:
```local RS = game:GetService("ReplicatedStorage")
script.Parent:WaitForChild("Value").Changed:Connect(function(val)
if val == true then
script.Parent.Enabled = true
else
script.Parent.Enabled = false
end
end)```
Tool Client Script:
local debounce = false
local RS = game:GetService("ReplicatedStorage")
script.Parent.Activated:Connect(function()
print("Clicked")
if debounce then
print("2")
debounce = false
RS:WaitForChild("MenuUI"):FireServer(false)
else
print("1")
debounce = true
RS:WaitForChild("MenuUI"):FireServer(true)
end
RS:WaitForChild("MenuUI"):FireServer()
end)```
