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

Im trying to have a data stringvalue show up on a textgui (Fix or rescript)?

Asked by 9 years ago

This script is suppose to show the DevilFruit value on a gui but the devilfruit is a string value, I think that's why it's not working.

while true do
script.Parent.Text = "DevilFruit" .. math.floor(script.Parent.Parent.Parent.Parent.Parent.Data.DevilFruit.Value)
wait(1)
end

2 answers

Log in to vote
0
Answered by
Scriptecx 124
9 years ago

You can't use math.floor with string values. If you are trying to put the value onto the text label, then simply put the value, and not math.floor. Please try to expand on your question. What are you trying to have it do?

0
Thanks it works now you're a genius :3 blestdude 0 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

This should help.

math.floor(tonumber(script.Parent.Parent.Parent.Parent.Parent.Data.DevilFruit.Value))

tonumber makes a value into a number, and if it can't be a number, it returns nil. Same with tostring, etc.

Answer this question