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: Help on a custom clone tool

Previous Thread :: Next Thread 
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 11:08 AM
Server:

local Clicked = script.Parent:WaitForChild("Clicked")

local Debounce = false

Clicked.OnServerEvent:connect(function(Plr,Args)
if Debounce == false then
Debounce = true
local Hint = Instance.new("Hint",workspace)
Hint.Text = Plr.Name.." cloned a part"
local Brick = Args[1]:Clone()
Brick.Parent = workspace
Brick.CFrame = Args[1].CFrame*CFrame.new(0,Args[1].Size.Y,0)
wait(.1)
Hint:Destroy()
Debounce = false
end
end)





Client:




local Clicked = script.Parent:WaitForChild("Clicked")

local Bin = script.Parent

Bin.Equipped:connect(function(Mouse)
Mouse.Icon = "rbxasset://textures\\GunCursor.png"
Mouse.Button1Down:connect(function()
if Mouse.Target ~= nil and Mouse.Target.Locked == false and Mouse.Target:IsA("BasePart") then
local Target = Mouse.Target
Clicked:FireServer(Bin.Parent.Parent,{Target})
end
end)
end)














Error:










10:07:50.634 - 1 is not a valid member of Workspace
10:07:50.635 - Script 'Players.Player.Backpack.Clone.CloneToolServer', Line 10
10:07:50.635 - Stack End
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
22 Jul 2015 11:10 AM
Please space it before you post a text wall. You apparently went workspace.1 or something, but I can't tell cuz it's a text wall.

▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 11:13 AM
it is not at all a wall of text, idiot. Also, no i didnt. I clicked a part and that should ahve been what fired.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
22 Jul 2015 11:15 AM
When I post code, I'm considerate to the people that are trying to help me. Thus I space code like such:
for i,v in pairs(game.Players:GetChildren()) do
local w = math.random(1, 2)
if w == 1 then
v.TeamColor = "Bright red"
else
v.TeamColor = "Bright blue"
end
end
while i < 1500 do
h.Text = "Time left: " .. 1500 - i
i = i + 1
wait(1)
end

Instead of
for i,v in pairs(game.Players:GetChildren()) do
local w = math.random(1, 2)
if w == 1 then
v.TeamColor = "Bright red"
else
v.TeamColor = "Bright blue"
end
end
while i < 1500 do
h.Text = "Time left: " .. 1500 - i
i = i + 1
wait(1)
end

▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
22 Jul 2015 11:19 AM
^
So you're saying you don't tab your code? You do realize that is a bad thing and makes code less readable, right?

Also the problem with your code is that you do this:

Clicked:FireServer(Bin.Parent.Parent,{Target})

When it should be:

Clicked:FireServer(Bin.Parent.Parent,{Mouse.Target})


Although I'm not sure why you're putting it in a table when there is only one object.
Report Abuse
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 11:19 AM
thats not being considerate at all. what i did is called indenting/
Report Abuse
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 11:20 AM
@nQ

same
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
22 Jul 2015 11:20 AM
No, of course I tab my code in. But I prefer to give it in that slightly organised format than a heap of words and mathematical functions.
▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
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