local id = script.Parent.ID.Value
local myname = game.Workspace:FindFirstChild("MyModel"..id)
I have a long script involving this problem so I created an example for the sake of time. there are models inside the workspace, the first part of the name is what the model is, the other part is the name of the owner of that model:
[[[ "name of model"..players name in a value ]]]
my current problem is I need to get the owner of a specific model but I want to leave the models name out. is there a way to basically cut a string name in half and use it seperately?
To do this you would use:
string.sub('variable', i, j)
Where 'variable' is the string that you're trying to separate, i is the start of the string that you want to separate and j is where you want the string to stop cutting or just leave it out to get any part of the string after 'i'.
Ex:
local ex = "abcdefghijk" print(string.sub(ex, 4))
This would print "defghijk" Ex 2:
local ex = "abcdefghijk" print(string.sub(ex, 4, 8)
This example would print "defgh"