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

Why does my script not work? [closed]

Asked by 8 years ago

I am trying to make a part checker and it's not working

console = {
    log = function(string) {print(string)}
}
function ontouch(obj) {
    if (!(obj.Name == "Chicken")) {
        for (i=0;i<10;i++) {
                console.log("It's not chicken")
        }
    }
}
0
1 d0nn0t kn0w l31k h0w 1s th1s n00t w0rking????!?!?! vry enraging LegitimatlyMe 519 — 8y
0
My frend gave me this so Idk why it's not workng User#5978 25 — 8y

Locked by User#5978, LegitimatlyMe, and YellowoTide

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by 8 years ago

You aren't connecting the event to the function, it's just causing a paralox in the stackoverflow.

console = {
    log = function(string) {print(string)}
}
function ontouch(obj) {
    if (!(obj.Name == "Chicken")) {
        for (i=0;i<10;i++) {
                console.log("It's not chicken")
        }
    }
}

<GetService(game, "Workspace").Part ontouch="ontouch()"></GetService(game, "Workspace").Part>
0
yeah yellwo come to the rescue! bosswalrus 84 — 8y
0
That's incorrect, by doing <basepart>, you are connecting it to ALL parts, use <Game.GetService(Game, "Workspace").Part ontouch="ontouch()"></Game.GetService(Game, "Workspace").Part> LegitimatlyMe 519 — 8y
0
thanks worked User#5978 25 — 8y
0
ahh, ty legit, edited YellowoTide 1992 — 8y
Ad