|
| 29 May 2015 07:59 PM |
local Terrain = workspace:WaitForChild("Terrain")
local On = false
script.Parent.Equipped:connect(function(Mouse) On = true Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() if On == true then if Mouse.Target ~= nil and Mouse.Target.Name == "CreatedBlock" then Mouse.Target:Destroy() Player.leaderstats.Blocks.Value = Player.leaderstats.Blocks.Value + 1 Player.leaderstats.Mined.Value = Player.leaderstats.Mined.Value + 1 else local Cell = Terrain:WorldToCellPreferSolid(Vector3.new(Mouse.Hit.x, Mouse.Hit.y, Mouse.Hit.z)) Terrain:SetCell(Cell.x, Cell.y, Cell.z, Enum.CellMaterial.Empty ,Enum.CellBlock.Solid,Enum.CellOrientation.X) Player.leaderstats.Blocks.Value = Player.leaderstats.Blocks.Value + 1 Player.leaderstats.Mined.Value = Player.leaderstats.Mined.Value + 1 end end end) end)
script.Parent.Unequipped:connect(function(Mouse) Mouse.Icon = "" On = false end)
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
| |
|
v3c3
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 674 |
|
|
| 29 May 2015 08:11 PM |
| What function of it isn't working? Any errors in the output? |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:16 PM |
Mouse is a nil value.
Yet everything is correct. I thought..?
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 30 May 2015 08:20 AM |
b
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|