doat
|
  |
| Joined: 28 Aug 2009 |
| Total Posts: 65 |
|
|
| 26 Jan 2016 09:25 PM |
Hello, I'm writing a script, but whenever I try to test it in game, 2 errors pop up: 1) new is not a valid member 2)Brickcolor is not a valid member of Part
Here's what the script looks like
Box = script.Parent.ShopFrame Button1 = script.Parent.ShopFrame.Accept Button2 = script.Parent.ShopFrame.Deny Open = true local debounce = false wait(1) Money = game.Players.LocalPlayer.leaderstats.SkateBux Part1 = game.Workspace.HalfpipeCount.Part1 Part2 = game.Workspace.HalfpipeCount.Part2
Button1.MouseButton1Down:connect(function(CloseAndStart) if Open ==true then Box.Visible = false Open = false print "Go" end end) function onTouched(hit) Part1.Brickcolor = Part1.Brickcolor.new("Lime green") wait(2) Part1.BrickColor = Part1.Brickcolor.new("Cashmere") end function Part2onTouched(hit) Part2.Brickcolor = Part2.Brickcolor.new("Lime green") wait(60) Part2.BrickColor = Part2.Brickcolor.new("Cashmere") end function onTouched(hit) if not debounce then debounce = true Part1.BrickColor = Part1.BrickColor.new("Lime green") if Part2.BrickColor == ("Lime green") then Money.Value = (Money.Value + 300) print "Awarded 300 SkateBux" wait(2) Part1.BrickColor = Part1.BrickColor.new("Cashmere") debounce = false
end end end
game.Workspace.HalfpipeCount.Part1.Touched:connect(onTouched) game.Workspace.HalfpipeCount.Part2.Touched:connect(Part2onTouched)
Button2.MouseButton1Down:connect(function(Close) wait(1) if Open ==true then Box.Visible = false Open = false end end |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2016 09:35 PM |
function onTouched(hit) Part1.Brickcolor = Brickcolor.new("Lime green") wait(2) Part1.BrickColor = Brickcolor.new("Cashmere") end function Part2onTouched(hit) Part2.Brickcolor = Brickcolor.new("Lime green") wait(60) Part2.BrickColor = Brickcolor.new("Cashmere") end function onTouched(hit) if not debounce then debounce = true Part1.BrickColor = BrickColor.new("Lime green") if Part2.BrickColor == ("Lime green") then Money.Value = (Money.Value + 300) print "Awarded 300 SkateBux" wait(2) Part1.BrickColor = BrickColor.new("Cashmere") --------------------------------------------------- Simple error, instead of;
"Part1.BrickColor = Part1.BrickColor.new("color")"
you just needed
Part1.BrickColor = BrickColor.new("color") |
|
|
| Report Abuse |
|
|
doat
|
  |
| Joined: 28 Aug 2009 |
| Total Posts: 65 |
|
| |
|