我正在尝试在 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)
我原以为当你给顾客提供错误的食物时,他就会消失,而你也拿不到钱
--没关系!我更改了脚本并且成功了!