钥匙卡门放入复制存储时无法正常工作

我有一扇钥匙卡门,但是当我把它放在复制存储中时它就不能工作了(它是一个游戏通行证钥匙)。有人能帮帮我吗?只有当放在 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)

原文链接 https://stackoverflow.com/questions/70382624

点赞
stackoverflow用户16200945
stackoverflow用户16200945

客户端是否正在传递密钥?(使用本地脚本)

编辑:也许尝试像这样的东西

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)
2021-12-17 00:11:26