Q&A for How to Script on Roblox

Return to Full Article

Search
Add New Question
  • Question
    Can I type capital letters in scripts?
    Community Answer
    Yes, but only if it is needed to make it right. Here is an example to show you: player.Name
  • Question
    How do I make a script that will make a model talk and answer questions?
    Community Answer
    Most people use the dialogue elements that can be entered by right-clicking the object in the explorer, clicking the "Insert Object" button, and finding dialogue. It doesn't require scripting.
  • Question
    How do parents and child work in scripts?
    Destinid10_2
    Community Answer
    They are easy to understand and apply. You can use .Parent to reference to the Parent of a item. For example: local part = script.Parent. Another practical example: local workspace = Part.Parent. For referencing Childs is a little more complex, because .Child doesn't exist. So I recommend you that when you're going to reference a Child, use basic referencing code, for example, like this: local part = game.Workspace.Part.
  • Question
    Can you teach me more about Functions? I'm not good at making Functions.
    Ziqian Gao
    Community Answer
    Functions ensure you don't type the same code over and over again. Functions can have values in them. To make a function, put local function NameHere()--Commands here--end. For a function with values in them, do the same above but with names in the parentheses "()" separated by commas. Local is optional. Values can be used only inside the function. Values can be a string, a number, a color, etc.
  • Question
    How do you make a button or a gui?
    Ziqian Gao
    Community Answer
    Put ScreenGui in StarterGui and then make a TextButton or an ImageButton and put a local script under the Button you Made and Put this: from 5 dashes to 6 dashes (-) -----function onclick()--what you want it to do on left click--end function onrightclick()--what you want it to do on right-click-endscript.Parent.MouseButton1Click:Connect(onclick)script.Parent.MouseButton2Click:Connect(onrig tclick)------. This is only for GUI on the screen. For the text with two dashes at the start, replace it with what you want it to do.
Ask a Question

      Return to Full Article