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

Why does my script not work?

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")
		}
	}
}

2 comments

0

1 d0nn0t kn0w l31k h0w 1s th1s n00t w0rking????!?!?! vry enraging

0

My frend gave me this so Idk why it's not workng

1 answer

✓ Accepted answer

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>

4 comments

0

yeah yellwo come to the rescue!

0

That's incorrect, by doing , you are connecting it to ALL parts, use <Game.GetService(Game, "Workspace").Part ontouch="ontouch()"></Game.GetService(Game, "Workspace").Part>

0

thanks worked

0

ahh, ty legit, edited

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