在尝试设置 Taco 的父级时,意外地尝试将 Taco 的父级设置为复制存储

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

我正在尝试在 roblox 上制作一款 Diner 游戏,但我的客户脚本无法正常工作,并且说是 bug 广告牌 GUI 文本的文本也是“Taco” 这是游戏 https://www.roblox.com/games /14311156877 代码:

local prox = script.Parent --lines 1/7 variables
local text = prox.Parent.Parent.BillboardGui.TextLabel
local tool = game.ReplicatedStorage.bread
local tool1 = game.ReplicatedStorage.Taco
local rand = math.random(1,2)
local t1e =false
local te = false

prox.Triggered:Connect(function(plr) -- when the proximity prompt is triggered
    if text.Text == "bread" then
        tool.Equipped:Connect(function() -- when bread is equipped
            te = true
            if te == true then
                tool.Parent = game.ReplicatedStorage
                prox.Parent.Parent.Parent = game.ReplicatedStorage  -- make the noob dissapear
                plr.leaderstats.Money.Value += 6
            else
                prox.Parent.Parent.Parent = game.ReplicatedStorage -- make the noob dissapear
                plr.leaderstats.Money.Value += 0
            end
        end)
        prox.Parent.Parent.Parent = game.ReplicatedStorage
    elseif text.Text == "Taco" then
        tool1.Equipped:Connect(function() -- when taco is eqquiped
            t1e = true
            
            if t1e == true then
                prox.Parent.Parent.Parent = game.ReplicatedStorage -- make the noob dissapear
                tool1.Parent = game.ReplicatedStorage
                plr.leaderstats.Money.Value += 7.5
            else
                prox.Parent.Parent.Parent = game.ReplicatedStorage --- make the noob dissapear
                plr.leaderstats.Money.Value += 0
            end
            
        end)
    end
end)

tool1.Unequipped:Connect(function()
    wait(0)
    t1e = false
end)

tool.Unequipped:Connect(function()
    wait(0)
    te = false
end)

我原以为当你给顾客提供错误的食物时,他就会消失,而你也拿不到钱

roblox
1个回答
0
投票

--没关系!我更改了脚本并且成功了!

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