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

What's the problem with this script?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

My goal was to create a brick, and name the brick and position it to (0,0,0). As of now, the brick was created and the position was correct, not sure if the name was.

http://prntscr.com/9f2yj2

0
I probably didn't explain my answer well, I hope I gave enough information because I'm wondering why you accepted my answer and then declined my answer as acceptable. GullibleChapV2 155 — 9y
0
Copy and paste your code here, don't post a screenshot of your code. BlueTaslem 18071 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

On line 2, you wrote:

var1.game.Workspace.Vector3.Position = Vector3.new(0,0,0)

This code, it's extremely incorrect.

The output states that game is not a valid member of var1, this is because game is not inside of var1, as it is locked.

The correct code would be:

var1.Position = Vector3.new(0,0,0)

For the other part, remove the current part and add this:

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        if plr.AccountAge > 10000 then
            print("String")
        end
    end)
end)

There is nothing wrong with this part of the code, just that you should use the playeradded function.

The reason it doesn't print is because the account age is 0.

http://wiki.roblox.com/index.php?title=API:Class/Players/PlayerAdded

0
If you want to check up with Vector3, visit this wiki page: http://wiki.roblox.com/index.php?title=Vector3 GullibleChapV2 155 — 9y
0
Any idea as to why the second portion of the script isn't working? The "if, then, end" part LogicIntel 35 — 9y
0
I edited my answer to accompany the second part of the code. GullibleChapV2 155 — 9y
Ad

Answer this question