0

I am having problems with the functionality of a script and I don't know how to solve it.

In the images below attach photos of the in-game problem, this means that the whole script works and in-game the property of the visible "bframe" is false but in-game this is not shown and I want to know how I can solve it ..

in-game mode the visibility of the "Bframe" it becomes false in the property (that's fine) but in-game this is not seen..

Does anyone know how to solve it?

Button script

-- Events
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Evento = ReplicatedStorage.RemoteEvent
-- end of Events
local button = script.Parent
local frame = script.Parent.Parent.Parent.Frame

Evento.OnClientEvent:Connect(function(argumento1)
    button.MouseButton1Click:Connect(function()
        if frame.Visible == false then
            frame.Visible = true
            button.Visible = false
        else
            frame.Visible = false   
        end
    end)
end)

Server script

-- Events
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Evento = ReplicatedStorage.RemoteEvent
-- end of Events

game.Players.PlayerAdded:Connect(function(player)
    Evento:FireClient(player,"argumento1")
    print("testing probado")
end)

Redteam / touch part script called script

local wll = script.Parent.Part
local fr = game.StarterGui.TeamChangerGui.BFrame

local function Toch()
    fr.Visible = false
    fr.button.Visible = false
    print("visible desactivado")
end

wll.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        Toch()
    end
end)

**images**

enter image description here

enter image description here

enter image description here

Matthew
  • 1
  • 3
  • If the visibility is set to false, the frame and all of it's descendents will not be visible in game. This seems to work. I don't understand what the problem is? – MrCodingB Jan 09 '21 at 16:50
  • The frame is not an object visible to the player. Per default it doesn't have anything that the player could see. You can only ever see the contents. Since the button has `visibility = false` there will be no difference if the frame is hidden or shown. – MrCodingB Jan 09 '21 at 16:55

1 Answers1

0

Is the button script a localscript? if it is then it may be to do with the fireclient although I am not good at it and I usually use fireallclients passing through the player name then checking if its the correct name on the clients side script.

Otherwise I am not sure as it is an interesting issue i have never encountered. Hope it works!

chippys385
  • 11
  • 1