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

Turning a string value into a non-string value?

I don't know how well i formated the question but i'll try to explain. I have a equip script that calls a certain function of a certain move based on a certain name. This is the script

mouse.KeyDown:connect(function(key) if key == "r" then r.Value.fire:FireServer()

end

end) I have all the variables set, but r.Value returns a string like "String" with quotes because it is a string value. How do i convert it to just String without quotes so i can call it in a script? Thanks in advance!

2 comments

0

you mean you want to access something by having a name that's stored in r.Value?

0

There is a StringValue child who's value changes based on what you equip, i want to use the value to call a script but because of the quotes,it's not working.

2 answers

If you want to access something by having a name (string) in value you can do it like this:

for example if you want to access something from workspace you would do it like this: workspace:FindFirstChild(r.Value), that's one way to do it.

Again idk if that's what you asked because the question wasn't formed so great. If it is what you were asking for then you just have to adjust it to your script.

Feel free to ask if you don't understand

Hey, thanks for the answer,but it's not what i need. I will try to explain better. I have a string value that changes based on what you click or equip. In the function i need to use the string value to activate a script. The problem is the string value is alway in quotes "String Value" but i need it without quotes so i chould call the script(ex. StringValue.FireScript:FireServer()) I don't know how to explain it better so i hope you get it this time.

1 comment

0

I'm trying to answer your question but a string is a string mate

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