Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Whats wrong in this script? [Level: Experienced Lua Masters]

Hello biocommand here with one question, I am trying to make something like a stamper tool, but as easy as possible so people can understand it´s code, heres the code:

function onClicked(playerWhoClicked)
   local brick = Instance.new("Part", game.Workspace) -- Creating the brick, and placing it into the Workspace
brick.Name = "NewBrick" -- This name has to correspond with the name of your brick on the map
brick.Size = Vector3.new(10, 10, 10) -- This is the size to which you want to change your brick
end
 
script.Parent.ClickDetector.MouseClick:connect(onClicked)

please tell me what I did wrong :( (I put this in a normal script I will try it on a local script)

3 comments

0

You did nothing wrong that I can see. You do know that the brick will spawn at 0,0,0, right?

0

do you know any solution for that? I mean for the brick spawning at 0,0,0?

0

bump.

1 answer

function onClicked(playerWhoClicked)
   local brick = Instance.new("Part", game.Workspace) -- Creating the brick, and placing it into the Workspace
brick.Name = "NewBrick" -- This name has to correspond with the name of your brick on the map
brick.Size = Vector3.new(10, 10, 10) -- This is the size to which you want to change your brick
brick.CFrame = Vector3.new(100, 0, 50) --change to ur Position...
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Edit: I forgot that it's not Pos. it's CFrame...

5 comments

0

Still doesn´t works :/

0

You have to put in the correct coordinates, of course .

0

yes Prci is Right... and the Person that Thumbs Up for me, thnx a lot! :D cos tons of people are so ignorant that they Thumbs Don for me for nothing... I guess I might stay a lil more on SH for some Time...

0

nvnonsinvdn it doesnt works :(

0

wait! brick.CFrame = Vector3.new()!

This discussion is preserved as it was. New answers, comments, and votes are closed.