【发布时间】:2019-01-10 15:12:57
【问题描述】:
嘿 stackoverflow 社区!我目前正在 ROBLOX 中开发自己的“大亨”游戏。但是,我遇到了脚本的一个小问题。所以基本上,当玩家购买一台名为“Dropper”的机器时,“Dropper”将创建灰色立方体。我遇到的问题是我希望灰色立方体改为石灰绿色霓虹灯球。我已经尝试了多种修复它的方法,但我还没有弄清楚。这是“Dropper”机器的脚本:
wait(2)
workspace:WaitForChild("PartStorage")
deb = true
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
if deb == true then
deb = false
local part = Instance.new("Part",workspace.PartStorage)
part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
part.Material=script.Parent.Parent.Parent.MaterialValue.Value
local cash = Instance.new("IntValue",part)
cash.Name = "Cash"
cash.Value = 1 -- How much the drops are worth
part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
part.FormFactor = "Custom"
part.Size=Vector3.new(1, 1, 1) -- Size of the drops
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
game.Debris:AddItem(part,20) -- How long until the drops expire
wait(.15)
deb = true
end
end)
为了澄清,我希望脚本生成一个石灰绿色的霓虹灯球,而不是当前的灰色块。任何帮助将不胜感激!
提前致谢, E.W
【问题讨论】:
标签: object colors lua scripting