如何让这个“仅限团队使用的物品”脚本运作?

这是我第一次编写Lua,所以我不太擅长。您的建议和纠正意见将意义重大!

以下是不起作用的代码:

game.Players.PlayerAdded:connect(function(plr)

    workspace.StarterPack:WaitForChild("Script")

    game:GetService(("Teams"):GetChildren()) do

        if plr.TeamColor == ("Really blue")then
            workspace.StarterPack.Script.Cuffs.State=Enabled:("True")
end)

代码位于:

  • Starter包

  • (内部)脚本

  • (内部)工具

点赞
用户10607258
用户10607258

你不应该以那种方式压缩代码,因为它会让它变得非常 'unreadable'。你有任何能够指引我们找到主要问题的调试信息吗?因为我注意到有几个非结束的块,比如 functionif statementdo

local function handleConnection( thePlayer )
    workspace.StarterPack:WaitForChild( "Script" )

    if ( thePlayer.TeamColor == "Really blue" ) then
        workspace.StarterPack.Script.Cuffs.State = true
    end
end

game.Players.PlayerAdded:connect( handleConnection )

你可以尝试使用这个代码块。所以,如果你能够提供任何你所受启发的源数据,我们就可以为你寻找的答案做出适应性调整。

2018-11-05 19:53:21