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

Why did the script does not work as expected?

Asked by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

I was playing around with my studio and I made this simple script:

script.Parent.Touched:Connect(function()
    print("hello")
    script.Parent.BrickColor = BrickColor.Red()
end)

Somehow, it does not prints "hello". However, the part turns red automatically. My part color in the game is green, but it shows as red whenever I play. Anyone have this same problem and any suggestions to fix it?

1
Maybe it's touching an unanchored part. That wouldn't explain the hello not being printed though.. maybe another script is editing the color... greatneil80 2647 — 3y
0
I tested the brick out with anchored and no other script is functioning to edit the part. Thanks for answering! Xapelize 2658 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

It's probably because you're sending too many requests. Add a wait or a debounce after. That's the only explanation I can think of. Though it doesn't make sense. I am also having unexplainable problems.

0
Thanks for answering, and sorry for the late respond. I was quitting scriptinghelpers for a while and now i'm back! Thanks alot for your respond :) Xapelize 2658 — 3y
Ad
Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago

Dude, looking back I might accidentally typed a space in the Output Find feature and "hello" itself doesn't have a space which might be the reason why the other lines appear but "hello" doesn't

This is the stupidest question I have ever made

Answer this question