Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How is this thing called? Not a script request, just a question to explain me?

EDIT. GO TO EDIT 2. ignore below

Howdy,

I know the following line is something that excists:

print("I mean this >"  ..YourThing.Value.. "< ")

But, can you do this for example too with like

script.Parent.Model(and then here the value).blabla

So like, it has to reach the model named Model1 (If value = 1 ofcourse)

Edit 1

So i mean. If i have a NumberValue set already inside the script (Val = 1 for now) i want to reach this line script.Parent.Model(number).ItemInHere to reach Model1, as 1 is the Value that's been set.

And if the value changes to 2 and the line is runned again, it goes to model2.

EDIT 2

So, this is my script which i want help for

function GetRanNumbPlace(RanNumb)
	if RanNumb == 1 then
		print("1")
		local	PlaceID = IDFolder.Place1.Value
		NewPlaceTo.Value = PlaceID
	elseif RanNumb == 2 then
		print("2")
		local	PlaceID = IDFolder.Place2.Value
		NewPlaceTo.Value = PlaceID
	elseif RanNumb == 3 then
		print("3")
		local	PlaceID = IDFolder.Place3.Value
		NewPlaceTo.Value = PlaceID
	elseif RanNumb == 4 then
		print("4")
		local	PlaceID = IDFolder.Place4.Value
		NewPlaceTo.Value = PlaceID
	elseif RanNumb == 5 then
		print("5")
		local	PlaceID = IDFolder.Place5.Value
		NewPlaceTo.Value = PlaceID
	else
		print("WRONG")
	end
end

what i want to make is that instead of manualy chaning the number ( like Place1, Place2, etc) at the lines "local PlaceID = IDFolder.Place1.Value" that it changes the line itself. the RanNumb has already been made, this function is called from another function.

i know there's something possible like IDFolder.Place[Number].Value

But, i can't figure that out.

9 comments

0

what

0

You don't get it? Let me edit my post

0

SPEAK. ENGLISH. HABLA ENGLESE???? i dont understand a single thing you're asking please use proper grammar and spelling in your question

0

if value == 1 then -- reach model end I don't understand a word

0

USE PROPER ENGLISH nothing here is coherent??? i know what you're trying to do, and you would do local var = "Model"...Value where value is some suffix to model and then do script.Parent[var].blabla but seriously dude just use proper spelling please

0

KirokiFreedom. Jesus you're toxic. Don't mind me grammar, i'm Dutch. You know there are other languages in this world then English?

0

i cant understand anything you're saying though, this is an english form and is meant to be used in english

0

next time, type your meaning in dutch and translate it using google C:

0

Greatneil80 if i would do that, it would look like if i was a chinese kid trying to speak English lol. Google Translate sucks if you use large texts.

1 answer

✓ Accepted answer

so like this??

function GetRanNumbPlace(RanNumb)
	local PlaceID = IDFolder["Place"..RanNumb].Value
	NewPlaceTo.Value = PlaceID
end

9 comments

0

No. i've edited my post to clear out my question ^_^

0

I think this should work :D

0

I recommend adding an if statement to check if the number exists, so like if IDFolder:FindFirstChild("Place"..RanNumb) then

0

I think that is the thing i'm looking for. Let me try it ^_^

0

if it works click accept thx :D

0

Doesn't work. If i set the number manualy it would sent me to a diferent (that's the function i want) but with your line, it doesn't work. But, there's also no error-log lol

0

I've tried this line btw (see below) but it doens't print the numb lol print(IDFolder["Place"..RanNumb].Value)

0

Okay, excuse me wtf. It's working now. I'm working in a TeamCreate server, and everytime i thought it was published to the server, (and it says it did) it didn't... My last game-update was 30 min ago. And now i published it again with 'Publish To' instead of normal 'Pubkish' button

0

rip LMAO, all good man

This discussion is preserved as it was. New answers, comments, and votes are closed.