英文:
roblox object pick up issue
问题
我在Roblox Studio中遇到了麻烦,当我点击物体时,会导致用户飞行或悬浮... 这是我的代码
local FrenchFries = script.Parent
local click = FrenchFries.ClickDetector
local function pickup(player)
local newTool = Instance.new('Tool')
newTool.Name = 'FrenchFries'
local handle = FrenchFries:Clone()
handle.Name = 'Handle'
handle.Parent = newTool
handle.Script:Destroy()
newTool.Parent = game.Workspace:FindFirstChild(player.Name)
end
click.MouseClick:Connect(pickup)
我期望物品能被拾取并持有。
英文:
im having trouble picking up an item in roblox studio, when i click the object, it causes the user to fly or levitate... here s my code
local FrenchFries = script.Parent
local click = FrenchFries.ClickDetector
local function pickup(player)
local newTool = Instance.new('Tool')
newTool.Name = 'FrenchFries'
local handle = FrenchFries:Clone()
handle.Name = 'Handle'
handle.Parent = newTool
handle.Script:Destroy()
newTool.Parent = game.Workspace:FindFirstChild(player.Name)
end
click.MouseClick:Connect(pickup)`
im expecting the item to be picked up and held`
答案1
得分: 0
解除工具或其零件的固定,并将它们与物体和工具连接起来,以防它们只是掉下来。问题在于,您固定了工具或其零件之一,这会将物体放置在放入工作区并将玩家发送到那里时的位置。在Roblox中,有些物体无法解除固定,就像脚本一样。
英文:
Unanchor the tool or it's parts and add wields to the object and the tool so they don't just fall. The issue was that you have the tool or one of it's parts anchored which places the object to where it was when you put it in workspace and send the player there. Some objects in Roblox, you can't unanchor them like a script.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论