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

Boolnumber speed help?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

Help! I have been trying to make it so it will go the speed of the boolvalue, What am I doing wrong

while true do 
wait(0.01)
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,script.Parent.Speed,0)
--Speed is the boolValue
end 
0
A boolean is a true/false value. It sounds like you need an integer. GoldenPhysics 474 — 9y
0
It's a numbeValue NotSoNorm 777 — 9y

1 answer

Log in to vote
1
Answered by
MrFlimsy 345 Moderation Voter
9 years ago

There are two things wrong here.

1: A bool (or boolean) is a true/false value. An number (or integer) cannot be stored in a bool value.

2: In order to access the value of a value object, you need to check it's Value property.

Change your BoolValue to an IntValue and use this code instead:

while true do 
wait(0.01)
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,script.Parent.Speed.Value,0)
end 
Ad

Answer this question