|
| 21 Apr 2012 12:03 PM |
tool = script.Parent dmg = 1
function oreCheck() if hit:FindFirstChild("Health") then for i,v in pairs(ores) do if hit.Name == v and hit:FindFirstChild("Health") then return true end end end end
function checkCell(vct) for i,v in pairs(Workspace.Mine:GetChildren()) do if v.Position == vct then return true else return false end end end
function clearOre(ore) for i,v in pairs(ore:GetChildren()) do if v.className == "Decal" or v.className == "Texture" then v:Destroy() end end end
function createBrick(pos) gemRare = math.random(1,50) print(gemRare) if gemRare < 51 then --Stone gem = game.Lighting.Stone:clone() gem.CFrame = CFrame.new(pos) end end
tool.Selected:connect(function(mouse) print("Selected") --- Prints this mouse.Button1Down:connect(function() print("Pressed") -- NEVER prints this. hit = mouse.Hit if oreCheck then ore = hit print("Pressed ore") if oreCanCollide == true then print("Non-dug brick") ore.Health.Value = ore.Health.Value - dmg print(ore.Health.Value) if ore.Health.Value <= 0 then print("Ore no health") ore.Transparency = 1 ore.CanCollide = false clearOre(ore) -- Create Animation DUN DUN DUN?!!?!??!!??!!? -- Check axis -- Bottom first = Vector3.new(0,0,ore.Size.Y/2,0) add = first*2 if checkCell(ore.Position - add) then print("No need for brick FACE BOTTOM") else createBrick(ore.Position - add) end -- Top first = Vector3.new(0,0,ore.Size.Y/2,0) add = first*2 if checkCell(ore.Position + add) then print("No need for brick FACE TOP") else createBrick(ore.Position + add) end -- Left first = Vector3.new(ore.Size.X/2,0,0,0) add = first*2 if checkCell(ore.Position - add) then print("No need for brick FACE LEFT") else createBrick(ore.Position - add) end
-- Right first = Vector3.new(ore.Size.X/2,0,0,0) add = first*2 if checkCell(ore.Position + add) then print("No need for brick FACE RIGHT") else createBrick(ore.Position + add) end
-- Front first = Vector3.new(ore.Size.Z/2,0,0,0) add = first*2 if checkCell(ore.Position + add) then print("No need for brick FACE FRONT") else createBrick(ore.Position + add) end
-- Back first = Vector3.new(ore.Size.Z/2,0,0,0) add = first*2 if checkCell(ore.Position - add) then print("No need for brick FACE FRONT") else createBrick(ore.Position - add) end end end end end) end)
I have tried this as a local and a normal script. This is in a hopperbin.
|
|
|
| Report Abuse |
|
|
| |
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 21 Apr 2012 12:30 PM |
hopperbin.Selected
It prints Selected but not Pressed |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 21 Apr 2012 12:33 PM |
> I have tried this as a local and a normal script. This is in a hopperbin.
xD |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 21 Apr 2012 12:37 PM |
Hopperbins are acting stupid. Their events don't work anymore.
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 21 Apr 2012 12:42 PM |
WHAT?!?!?!??!?!?!?!?!? Ugh WHEN FIXED? |
|
|
| Report Abuse |
|
|