【发布时间】:2020-02-10 15:56:29
【问题描述】:
我想在 Roblox Studio 中制作一种大厅系统,如果你有 4 个人在其中,你会被派往另一个地方。我试图为它建立一个系统,但它不起作用;你能帮我解决这个问题吗?
我试过让它在结尾显示 .Value。
local TeleportService = game:GetService("TeleportService")
player_amount = script.Parent.Parent.Parent.Player_Count
local placeID_1 = 4119652438
local function onPartTouch(otherPart)
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
player_amount.Value = player_amount.Value + 1
end
if player_amount == 4 then
TeleportService:Teleport(placeID_1, player)
end
end
script.Parent.Touched:Connect(onPartTouch)
我希望输出为 0,然后如果有人踩到它,它会将标志更新为 1。但它只停留在 0。
【问题讨论】:
-
在我看来,您正在增加 IntValue 或类似的值。如果您想更改标志,最好使用
.Text = etc...引用文本