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

How do I change the width of A beam?

Asked by 3 years ago

I honestly have no clue how to script, this was just an attempt. I am trying to change the width of a beam, this is my script.

while true do wait()
script.Parent.Width0 = math.random()*15
script.Parent.Width1 = math.random()*15
script.Parent.Transparency = NumberSequence.new(1,1)
script.Parent.Enabled = true
end
0
is this a local, or server script? If it is a server script, i think the size is a vector value, not the way you did it. Xyternal 247 — 3y
0
The beam is always transparent, because of line 4. Does that ring any bells? RAFA1608 543 — 3y
0
RAFA the transperancy thing has to do with something else it's just in the same line of code. The beam is viewable, I just want to randomly change it's width on startup. EvilBoy1617 0 — 3y
0
^^ Actually, a transparency of 1 should make it invisible. You're able to replace the NumberSequence with simply the number 1. sngnn 274 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

I may be wrong but I believe that it's because there is nothing in the math.random().

Normally, it's

math.random(0,5)

for example.

The first number is the minimum amount and the second number is the max, but these can't be interchanged otherwise it doesn't work.

Also, instead of while true do, try while wait() do, as it's similar to while true do but instead of looping code, it waits before looping, then once the script inside is done, it waits again and repeats.

You should also remove the wait() since it probably won't work there.

If none of this worked, try checked output.

0
Thanks for the help, it still didn't work tho, I don't quite know what checked output is. EvilBoy1617 0 — 3y
0
The math.random function returns a number with decimals between 0 and 1 if all of its arguments are nil. RAFA1608 543 — 3y
Ad

Answer this question