如何阻止 Motor6D 自动添加到装备

问题描述 投票:0回答:1

我正在 Roblox Studio 上为 R15 装备制作布娃娃系统,虽然服务器中的布娃娃上没有 Motor6D,但客户端在布娃娃上生成 Motor6D,将死装备置于某种平台支架位置,而不是让球窝和铰链会四处晃动。我该如何做到这一点,而不是这样做?我编写了一个本地脚本,删除了它在我为布娃娃指定的工作区“尸体”文件夹中找到的所有 Motor6D,但它仍然会出现故障,并且更新速度不够快,无法将 Motor6D 排除在布娃娃之外,所以有时它们会回来瞬间重置布娃娃的位置,然后让它再次翻倒。

TLDR:如何才能使 Motor6D 不会在客户端生成 R15 装备,特别是当玩家的角色位于所述装备附近时?

roblox
1个回答
0
投票

将其作为 LocalScript 放入

StarterPlayerScripts
StarterGui
中。

game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
   char.DescendantAdded:Connect(function(thing)
      if thing == nil then return end
      if thing:IsA("Motor6D") then thing:Destroy() end
   end)
end)

这应该会删除添加到本地角色中的所有 Motor6D。

© www.soinside.com 2019 - 2024. All rights reserved.