New smart math NPC

ok! Thank you for telling me that

He knows pi now
Capture
this is the script:
Capture1

1 Like

First, there was a math library that already says the pi value, second the pi value is wrong, you could do

math.pi

oops i did a mistake
Capture1
pi is 3.1415 not 3.1459

Why not do

chat(math.pi)

I know but I want it to chat this only

You can use the round function

function round(num)
return math.floor(num+0.5)
end
chat(round(math.pi))
1 Like

I send you a friend request in roblox

1 Like

yes I know it but i want him to chat this exactly with …

I have to go Goodbye have a good day

1 Like

So therefore, you can

function round(num)
return math.floor(num+0.5)
end
chat(tostring(round(math.pi)).."...")
1 Like

pls accept me to be friend in roblox

1 Like

ok

I think you could just use loadstring for the map

Or just do
``
function round(num)
return math.round(num)
end

1 Like

if you wanna approximate it, like make the number bigger if it’s above five then I had to add +0.5

1 Like

Yes, but math.round does that automatically instead of using math.floor(num+0.5).

1 Like

This npc is becoming smarter :

and this is the script :

Capture

and This is the game if you want to try the npc :

just say : what is x,y or, what is sqrt x, to make him solve

2 Likes

nice

I make another post : Change part color with a simple GUI