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

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

Asked by 4 years ago
Edited 4 years ago

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.

0
what greatneil80 2647 — 4y
0
You don't get it? Let me edit my post HeadlessDeathSpeaker 9 — 4y
0
SPEAK. ENGLISH. HABLA ENGLESE???? i dont understand a single thing you're asking please use proper grammar and spelling in your question glidrbanana 20 — 4y
0
if value == 1 then -- reach model end I don't understand a word greatneil80 2647 — 4y
View all comments (5 more)
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 glidrbanana 20 — 4y
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? HeadlessDeathSpeaker 9 — 4y
0
i cant understand anything you're saying though, this is an english form and is meant to be used in english glidrbanana 20 — 4y
0
next time, type your meaning in dutch and translate it using google C: greatneil80 2647 — 4y
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. HeadlessDeathSpeaker 9 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

so like this??

function GetRanNumbPlace(RanNumb)
    local PlaceID = IDFolder["Place"..RanNumb].Value
    NewPlaceTo.Value = PlaceID
end
0
No. i've edited my post to clear out my question ^_^ HeadlessDeathSpeaker 9 — 4y
0
I think this should work :D greatneil80 2647 — 4y
0
I recommend adding an if statement to check if the number exists, so like if IDFolder:FindFirstChild("Place"..RanNumb) then greatneil80 2647 — 4y
0
I think that is the thing i'm looking for. Let me try it ^_^ HeadlessDeathSpeaker 9 — 4y
View all comments (5 more)
0
if it works click accept thx :D greatneil80 2647 — 4y
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 HeadlessDeathSpeaker 9 — 4y
0
I've tried this line btw (see below) but it doens't print the numb lol print(IDFolder["Place"..RanNumb].Value) HeadlessDeathSpeaker 9 — 4y
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 HeadlessDeathSpeaker 9 — 4y
0
rip LMAO, all good man greatneil80 2647 — 4y
Ad

Answer this question