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 » Scripting Helpers
Home Search
 

Re: Editing the copy tool

Previous Thread :: Next Thread 
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
13 Aug 2013 04:03 PM
Im Editting a copy tool so that when u copy the brick it changes the color to a random one.

Im not getting it to work, help.
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
13 Aug 2013 04:08 PM
I would need to see the script to help you.
Post it here please.

==Salinas23, LMaDer since August 2012! Scripter since July 2013!
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
13 Aug 2013 04:10 PM
debounce = false
local vPlayer = game.Players.LocalPlayer
local SBox = Instance.new("SelectionBox")
local Tool = script.Parent;

local Select
local Orig
local Dragger

function onButton1Down(mouse)

local Target = mouse.Target
local Sound = Instance.new("Sound")-- The "ding" sound
Sound.SoundId = "rbxasset://sounds\\electronicpingshort.wav"
Sound.Name = "PewPew"
Sound.Parent = Tool

if Target and Target:IsA("BasePart") and not Target.Locked then
if debounce == false then
debounce = true
Orig = Target
Select = Orig:clone()

Select.Parent = game.Workspace
Select.Position = Orig.Position + Vector3.new(0, 0.4, 0)

Dragger = Instance.new("Dragger")
pcall(function() Dragger:MouseDown(Select, Vector3.new(0, 0, 0), {Select}) end)

SBox.Adornee = Select
Sound:Play()
wait(0.25)-- Edit this to how long you would like to wait until the next copy
mouse.Icon = "rbxasset://textures\\DragCursor.png"
debounce = false
end
end
end

function onButton1Up(mouse)
if Dragger then
Orig = nil
pcall(function() Dragger:MouseUp() end)
Select = nil
SBox.Adornee = nil
Dragger = nil
mouse.Icon = "rbxasset://textures\\CloneOverCursor.png"
end
end

function onMouseMove(mouse)
if Dragger then
mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
else
local Target = mouse.Target
if Target and Target:IsA("BasePart") and not Target.Locked then
mouse.Icon = "rbxasset://textures\\CloneOverCursor.png"
else
mouse.Icon = "rbxasset://textures\\CloneCursor.png"
end
end
end

function onKeyDown(key)
if Dragger then
key = key:lower()
if key == 'r' then
Dragger:AxisRotate(Enum.Axis.Y)
elseif key == 't' then
Dragger:AxisRotate(Enum.Axis.Z)
end
end
end

function onEquippedLocal(mouse)
SBox.Color = BrickColor.new("Cyan")
SBox.Parent = vPlayer.PlayerGui

mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.Move:connect(function() onMouseMove(mouse) end)
mouse.KeyDown:connect(onKeyDown)
end

function onUnequippedLocal(mouse)
if Tool:findFirstChild("PewPew") then
Tool.PewPew:remove()
end
if Dragger then
Orig = nil
pcall(function() Dragger:MouseUp() end)
Select = nil
SBox.Adornee = nil
Dragger = nil
end
end

Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)

--Credit to LinkIsaiah for adding (the so simple) waiting process.
--Credit to whomever made the meshes.

Here u go
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 04:12 PM
Why? Just use HoppinBin ;\ ;D
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
13 Aug 2013 04:16 PM
errrrrrr.

Im trying to make the tool make the clone brick a random color T_T
Report Abuse
JulianCookie is not online. JulianCookie
Joined: 02 Jul 2013
Total Posts: 158
13 Aug 2013 04:26 PM
But how? Wow creative but.wow
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
13 Aug 2013 05:44 PM
Help out please its for my group
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 05:50 PM
:\ A 'Clone too',l is for your 'group'..?
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
13 Aug 2013 06:00 PM
err.....

Its supposed to copy bricks into a random color. EG.

Theres a grey brick, a guys with the tool would come and copy it. The copied brickcolor changes.

It can be usful in the mini building field

Buts its not working
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 06:06 PM
for i,v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Part") then
v.Name == "Brick"
v.BrickColor = BrickColor.random()
end
end

Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 06:09 PM
Make that a function, edit it and then boom you're cooking on gas? :D
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 06:12 PM
--Dont listen to these narbs
debounce = false
local vPlayer = game.Players.LocalPlayer
local SBox = Instance.new("SelectionBox")
local Tool = script.Parent;

local Select
local Orig
local Dragger

function onButton1Down(mouse)

local Target = mouse.Target
local Sound = Instance.new("Sound")-- The "ding" sound
Sound.SoundId = "rbxasset://sounds\\electronicpingshort.wav"
Sound.Name = "PewPew"
Sound.Parent = Tool

if Target and Target:IsA("BasePart") and not Target.Locked then
if debounce == false then
debounce = true
Orig = Target
Select = Orig:clone()

Select.Parent = game.Workspace
Select.BrickColor = BrickColor.random()
Select.Position = Orig.Position + Vector3.new(0, 0.4, 0)

Dragger = Instance.new("Dragger")
pcall(function() Dragger:MouseDown(Select, Vector3.new(0, 0, 0), {Select}) end)

SBox.Adornee = Select
Sound:Play()
wait(0.25)-- Edit this to how long you would like to wait until the next copy
mouse.Icon = "rbxasset://textures\\DragCursor.png"
debounce = false
end
end
end

function onButton1Up(mouse)
if Dragger then
Orig = nil
pcall(function() Dragger:MouseUp() end)
Select = nil
SBox.Adornee = nil
Dragger = nil
mouse.Icon = "rbxasset://textures\\CloneOverCursor.png"
end
end

function onMouseMove(mouse)
if Dragger then
mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
else
local Target = mouse.Target
if Target and Target:IsA("BasePart") and not Target.Locked then
mouse.Icon = "rbxasset://textures\\CloneOverCursor.png"
else
mouse.Icon = "rbxasset://textures\\CloneCursor.png"
end
end
end

function onKeyDown(key)
if Dragger then
key = key:lower()
if key == 'r' then
Dragger:AxisRotate(Enum.Axis.Y)
elseif key == 't' then
Dragger:AxisRotate(Enum.Axis.Z)
end
end
end

function onEquippedLocal(mouse)
SBox.Color = BrickColor.new("Cyan")
SBox.Parent = vPlayer.PlayerGui

mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.Move:connect(function() onMouseMove(mouse) end)
mouse.KeyDown:connect(onKeyDown)
end

function onUnequippedLocal(mouse)
if Tool:findFirstChild("PewPew") then
Tool.PewPew:remove()
end
if Dragger then
Orig = nil
pcall(function() Dragger:MouseUp() end)
Select = nil
SBox.Adornee = nil
Dragger = nil
end
end

Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 06:42 PM
:o you have insulted my troll :D also narbs = woah no back killing you :D
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 06:45 PM
I shall kill all u narbs

*kills self*

mind fruck ryt
Report Abuse
manofthebase44 is not online. manofthebase44
Joined: 14 Feb 2012
Total Posts: 2221
13 Aug 2013 07:04 PM
lel'z
Report Abuse
JulianCookie is not online. JulianCookie
Joined: 02 Jul 2013
Total Posts: 158
13 Aug 2013 08:08 PM
No...Just No,
Just test.
Report Abuse
Rasheedkeon789Alt is not online. Rasheedkeon789Alt
Joined: 05 Apr 2013
Total Posts: 373
14 Aug 2013 10:32 AM
Works like a charm. THank you all.

A mod can close this now
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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