LocalScript & ModuleScript on Roblox • jotslo

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 20

  • @jotslo
    @jotslo  2 ปีที่แล้ว +3

    It seems that a lot of you are struggling with question 4 of the plugin episode.
    If you're unsure, I have published the solution & explanation here: gist.github.com/jotslo/984381b439aaf983f72c29e063ecdd62
    ---
    Update: If you want to place a script somewhere outside of the folders mentioned in the video, take a look at the new RunContext feature, which is currently in beta.
    Learn more: devforum.roblox.com/t/beta-script-runcontext/1938784

  • @YM2IT
    @YM2IT 2 ปีที่แล้ว +1

    Amazing, you made a scripting newbie understand localscript easily. DESERVES MORE SUBS AND VIEWS!!!

  • @gunipotys
    @gunipotys ปีที่แล้ว

    Will you post others tutorial videos ? By the way, your videos are extremly useful ! Everything is explained so well !

  • @Blank_King01
    @Blank_King01 ปีที่แล้ว +1

    I dont understand question 4 pls give me another hint I spent 2hours on that already

    • @jotslo
      @jotslo  ปีที่แล้ว

      I think the best way to solve it, is to take each segment of the challenge step-by-step.
      1) First, create a function in your ModuleScript, which has one parameter. Your ModuleScript should be returning a reference to that function. (i.e. return functionName)
      2) In the function, take the parameter, concatenate it with a smiley, and then return the new string.
      3) In your main script, require the ModuleScript, and assign it to a variable for instance. This variable is now assigned to the function in your ModuleScript, so you can call it and then output the result.
      The idea of the challenge is to teach you that you can return any datatypes, rather than just tables as is commonly thought amongst some developers.
      Hope this helps!

  • @polmistical
    @polmistical ปีที่แล้ว

    i need help on question 4(local & module)
    returning a function wont work, and i dont know how to activate the function datatype when requiring.

    • @jotslo
      @jotslo  ปีที่แล้ว +1

      Hey, thanks for the question!
      You can see an example of this at the bottom-right corner at 4:02 in this tutorial.
      The idea is that a function is a datatype that can be assigned to a variable, and so you can return the function datatype itself.
      Hopefully this helps, let me know if you’re still unsure!

  • @gluteusmaximus7496
    @gluteusmaximus7496 ปีที่แล้ว

    looks like something is wrong with the plugin, I copied the solutions and pasted them in, but the output is still saying this:
    ScriptMate - Exercise failed.
    Requested module experienced an error while loading
    It could just be my studio

    • @jotslo
      @jotslo  ปีที่แล้ว

      The example script is separated into examples, and can't be pasted on itself - could that be where you're going wrong?
      For example, you could just use "module script example 1" in your ModuleScript with nothing else, and then the main script example in your ScriptMateEnv.
      If you're still having issues, feel free to let me know the exact code you're using in your modulescript, and I can try to help!

    • @nysm2k
      @nysm2k ปีที่แล้ว

      @@jotslo yo bro, its happening to me aswell, copied the code and it doesnt seem to show anything, and yes I separated them properly

  • @bt_coding
    @bt_coding ปีที่แล้ว

    I need a bit of help with question 3 it seems im doing something wrong with returning the table from the modulescript

    • @jotslo
      @jotslo  ปีที่แล้ว

      Hey, are you still looking for help or have you solved it?

    • @bt_coding
      @bt_coding ปีที่แล้ว

      @@jotslo Sorry for the late reply, heavent been on this account for a bit but yea i found the solution it was in the video.

  • @ace7555
    @ace7555 ปีที่แล้ว

    hey idk if you still respond to these videos however for some reason i get this error code on the 4th question: "Module code did not return exactly one value" i have tried everything even copy pasted your solution from github yet it still gives me that error code, is there any way you could help me? loving the vids so far really easy to follow except for this one xD
    edit: nvm it worked for some reason after restarting roblox studio ? lol

  • @eterum1204
    @eterum1204 ปีที่แล้ว

    I do not understand question 4

  • @darkstar76
    @darkstar76 ปีที่แล้ว

    i cant require from a local script

    • @jotslo
      @jotslo  ปีที่แล้ว

      Make sure your ModuleScript is in a place that your LocalScript has access to

  • @HpError
    @HpError ปีที่แล้ว

    you so good at explainning

  • @Thundeeerzin
    @Thundeeerzin ปีที่แล้ว

    wth is question 4 😭it's so hard

    • @CephuGaming
      @CephuGaming ปีที่แล้ว

      its simple create a function newString(string) print(string.. " :)" require it in the script tester then call it with a random string as an argument