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

can i convert peramaters to a string in roblox?

Asked by 4 years ago

if this makes more sense

function example (anyparamater)
print (anyperamater)
--this line somehow converts anyperamater to a string--
end
example(hello)

what I want to know is how to make it print hello without the parameter being a string and the output should be the same with it being a string so the output in both ways should be saying hello

0
What is your use case though programmerHere 371 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Hi superspeedr1234!

I am not completely sure about this, but I think there is a function called tostring().

function example(anyparameter)
      print(anyparameter)
      local string = tostring(anyparameter)
end
example(hello)

Not sure if this works, but hope it does.

LennyPlayzYT

0
k ill try LTRNightmare 66 — 4y
0
ill give you credit it dose print but its nil LTRNightmare 66 — 4y
0
Because anyparameter doesn't have a value LennyPlayzYT 269 — 4y
0
I think at least LennyPlayzYT 269 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

This is not possible.

1
thanks thats a bummer tho LTRNightmare 66 — 4y
0
tostring()? LennyPlayzYT 269 — 4y

Answer this question