Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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)

0
You did nothing wrong that I can see. You do know that the brick will spawn at 0,0,0, right? Perci1 4988 — 10y
0
do you know any solution for that? I mean for the brick spawning at 0,0,0? biocommand 30 — 10y
0
bump. biocommand 30 — 10y

1 answer

Log in to vote
1
Answered by
KAAK82 16
10 years ago
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...

0
Still doesn´t works :/ biocommand 30 — 10y
0
You have to put in the correct coordinates, of course . Perci1 4988 — 10y
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... KAAK82 16 — 10y
0
nvnonsinvdn it doesnt works :( biocommand 30 — 10y
0
wait! brick.CFrame = Vector3.new()! KAAK82 16 — 10y
Ad

Answer this question