script 在 roblox studio 中能够正常运行但游戏中没有任何反应

我在一个脚本的功能上遇到了问题,不知道该如何解决。

在下面的图片中附上了游戏中的问题,即整个脚本可以正常工作,在游戏中,可见"bframe"的属性为false,但是游戏中却没有显示出来,我想知道如何解决这个问题..

在游戏模式中,"Bframe"的可见性在属性中变为false(这没问题), 但在游戏中却看不到...

有人知道如何解决吗?

按钮脚本

-- 事件
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Evento = ReplicatedStorage.RemoteEvent
-- 事件结束
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)

服务器脚本

-- 事件
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Evento = ReplicatedStorage.RemoteEvent
-- 事件结束

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

红队/触摸部分脚本被称为脚本

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)

**图片**

在此输入图片描述

在此输入图片描述

在此输入图片描述

点赞
用户20854292
用户20854292
**问题描述**

这个按钮脚本是一个 LocalScript 吗?如果是的话,可能与 FireClient 相关,尽管我不太擅长它,通常我会使用 FireAllClients 通过传递玩家名称来检查客户端脚本上的正确名称。

否则,我不确定,因为这是一个有趣的问题,我从未遇到过。希望可以解决!
2022-12-24 15:44:54