generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Simple script - Wont work

Previous Thread :: Next Thread 
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
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 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
29 May 2015 08:06 PM
im sure u said simple
Report Abuse
v3c3 is not online. 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
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
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
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image