【问题标题】:Keycard door not working properly when putted in replicated storage放入复制存储时,钥匙卡门无法正常工作
【发布时间】:2022-01-19 18:09:50
【问题描述】:

我有一个钥匙卡门,但是当我将它放入replicatesStorage 时它不起作用(它是一个游戏通行证钥匙)有人可以帮我它只在放入starterPack 时才起作用**这里是代码:

script.Parent.Touched:Connect(function(hit)
    if hit.Parent.Name == "Clearance1" then
        script.Parent.CanCollide = false
        script.Parent.Transparency = 0.5
        wait(0.5)
        script.Parent.CanCollide = true
        script.Parent.Transparency = 0
    end
end)

【问题讨论】:

  • 它在 StarterScreenGui 的本地脚本中给出
  • 当你说它不起作用时,有点不清楚 what 不起作用。放入 ReplicatedStorage 的“它”是什么?门本身是否在 ReplicatedStorage 中?游戏通行证密钥是否存储在 ReplicatedStorage 中?这段代码是在 LocalScript 还是 Script 中?您能否在您的问题中添加更多细节,说明它应该做什么以及正在发生什么?

标签: lua roblox


【解决方案1】:

是在客户端提供的密钥吗? (带有本地脚本)

编辑:也许尝试类似的东西

game.Players.PlayerAdded:Connect(function(player)
  player.CharacterAdded:Connect(function(character)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,0000000) then
      game.ReplicatedStorage.KeyCard:Clone().Parent = player.Backpack
    end
  end)
end)

【讨论】:

  • 它在 StarterScreenGui 的本地脚本中给出
  • 如果你在客户端提供东西,它不会与服务器正常交互。您不应该在客户端上提供游戏通行证。我会用一个你可以做什么的例子来编辑回复
猜你喜欢
  • 2022-01-20
  • 2023-03-23
  • 1970-01-01
  • 2013-04-23
  • 2016-05-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多