【发布时间】:2021-09-05 19:44:57
【问题描述】:
我制作了一个答题器,将我的武器从 ServerStorage 发送到 StarterPack,效果非常好。我之所以没有将工具发送到PlayerBackpack而不是StarterPack,这是因为我的战斗,动画系统在ServerScriptService中。我将它发送到 Player Backpack,但没有任何效果。但我发现将工具发送到 StarterPack 将使所有玩家能够在他们死亡时接收它。那肯定是个大问题。
所以,我的问题是:无论如何让 StarterPack 向特定玩家发送工具。例如:在大亨游戏中,如果您声称该房子,点击器会将工具发送给该房子的玩家,而不是其他人。
如果不可能,我会很高兴收到您的任何建议。
如果有必要,这是我的点击脚本..
local ClickDetector = script.Parent.ClickDetector
local canGiveGun = true
ClickDetector.MouseClick:Connect(function(player)
local starterpack = game.StarterPack
local MetalBatCombat = game.ServerStorage:FindFirstChild("MetalBatCombat")
local batClone = MetalBatCombat:Clone()
for i,v in pairs(starterpack:GetChildren()) do
if v.Name == "MetalBatCombat" then
canGiveGun = false
end
end
if canGiveGun then
batClone.Parent = starterpack
local char = player.Character
local human = char.Humanoid
human.Health = 0
end
canGiveGun = true
end)
【问题讨论】: