What should I learn about the API to be a good roblox scripter?

Hello everyone, I hope you are all very well at home, I would like to know what I must learn in terms of API to be a good scripter?

What would you recommend me to learn about the API and the lua language? according to your experiences.

Beforehand, sorry if I’m in the wrong category, but I didn’t know where to post this … hugs!

3 Likes

A good scripter has a well-rounded overall knowledge of the language and API. There isn’t really anything that you shouldn’t learn. As for what you should learn first, the best way to figure that out would be by putting together prototypes of games and researching topics in the API as they come up in the development. That’s how I learned and it’s been a very efficient way to gain knowledge without learning stuff I won’t need yet.

4 Likes

metamethods and OOP if you don’t already know it. It will be helpful in the long run. Also advanced data saving and manipulation. Details on DataStoreService for Advanced Developers

2 Likes

Also you shouldn’t worry about how much stuff you know. You will learn as you make more games and stuff. Everyone learns at a different place so take your time if you need to! Of course you should try to learn and try new things but just incase you are you shouldn’t rush that process

4 Likes

Personally for me, I’d learn about Vector3’s, CFrames, and BodyObjects (RocketPropulsions are cool as well)

Thing is, you can start anywhere on the API really & you can already become good just from the knowledge that you know, it just takes a lot of practice & understanding as to know the basic foundations on the types of objects you’re searching for really

There’s no exact/specific API(s) to learn in order to be a good scripter, again practice makes perfect even if it takes 2-3 years :wink:

2 Likes

Thank you all very much for your comments.

My idea is to create the following:

  • build system
  • Gun firing system
  • save models with datastore, save player position

I can’t find information anywhere on how to do this, any ideas?

For Building Systems and Gun Firing Systems, raycasting is an important thing to familiarize yourself with.

1 Like

For the build and gun system, you should try to learn ray casting. This is what most people use to make those. For the datastore system its basically just saving the position of each part but of course you should find a way to save this data efficiently and safely

2 Likes

Excuse the question but …

Do you think it is possible to share some commented code to me to better understand the whole process?

  • Ray casting
  • save player position
  • save parts/models

Build/Gun System you could get the Mouse’s Position & Raycast depending on how you want to approach it :thinking: It’s actually really fun

DataStores on Models/Parts, you’d need to convert them into strings/bools/numbers as you can’t exactly save Instances inside them, but we do have our work-arounds to save them

For the Positions of the Parts you can save all of the X/Y/Z values individually

1 Like

Don’t try and learn things you don’t need to learn right off the bat. Only learn things that you believe are essential to the code you are trying to make/perfect. The Roblox LUA documentation is full of things, many of them you may never even use. It’s not worth it trying to learn all of the worthless stuff while you could be spending more time learning about the things that are actually useful.

I do believe simple things such as functions, variables, conditional statements, etc. should be learned relatively quickly, as they are apart of almost every coding language, however I wouldn’t worry about trying to learn everything that is exclusive to Roblox LUA.

Don’t be afraid to use google to look up some documentation you don’t understand, or looking for some help on something. The best of the best do the same thing I’m pretty sure.

1 Like

Learn to not be afraid to look at docs. The most experienced developers still look at docs. Don’t think because you need to reference documentation means that you’re not a good programmer. Software is constantly changing and evolving, beta features are being tested and implemented. Look for new things. I’ve taken about 4 CIS classes at college and the biggest point they drive is to know how to search and use docs to your advantage. Understand why they’re there as a resource.

2 Likes
--Example A: Raycasting - Gun
local Player = game.Player.LocalPlayer
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent") --We want to send a RemoteEvent from the client-server to receive it's Mouse Position
local Mouse = Player:GetMouse()
local Tool = script.Parent

Tool.Activated:Connect(function()
    Event:FireServer(Mouse.Hit.Position) --Position would be a Vector3 Value
end)

Raycasting has a couple of things to keep in mind about:

  • RaycastParams you can assign, where you can filter out certain parts you don’t want to detect using the Whitelist/Blacklist (But that’s optional)

  • Having a Ray Origin (Starting Point) & Ray Direction (Direction where you want the bullet to fire)

--Server Script that would handle the Raycasting
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

Event.OnServerEvent:Connect(function(Player, MousePos)
    local Params = RaycastParams.new() --Creating our Parameters
    Params.FilterType = Enum.RaycastFilterType.Blacklist --This will detect anything except whatever we put inside our "FilterDescendantsInstances"
    Params.FilterDescendantsInstances = {Player.Character} --We don't want to detect the Character that fired the ray lol
    
    local Distance = 500 --You can change this to how far you want the ray to go
    local RayOrigin = Player.Character.HumanoidRootPart.Position --This is where the Ray would start out
    local RayDirection = (MousePos - RayOrigin).Unit * Distance --This is where the ray would go

    local Result = workspace:Raycast(RayOrigin, RayDirection, Params) --We'll fire a ray here

    if Result then --Checking if the Ray hit something, if it does we can confirm a check
        print("The ray hit something!")
    end
end)

Sure it may look a bit complicated, but if you dumb it down a bit then you can hopefully understand it a bit better!

Oh yeah there’s also this as well:

3 Likes

Wow I get it completely! Thank you very much, I really appreciate it very much! :smiley:

And thank you all for your comments too, really! :smiley: :smiley:

1 Like