#code-discussion

1 messages · Page 116 of 1

nimble cypress
#

like gui vs yk basic scripting

wind spindle
#

Oh i didn

#

dind't see that channel

scenic lotus
#

what about the output?

sly plover
#

oh

#

wait it works now

#

i just restarted my game

sly plover
scenic lotus
#

I think it doesn't pass if ... then

thick kelp
#

Print the chil var

wind spindle
wind spindle
#

or "if character:FindFirstChild("ForceField") then"

scenic lotus
#

You should try print(child) first

#

actually, does the spawner give forcefield when spawn or it never give forcefield from the beginning

wind spindle
scenic lotus
worldly sonnet
#

so most parts in my game have the 'grid' texture and i feel like its bad for performance, are there any ways i can make it better for performance

tame compass
#

Is this how you make rounds system?

#

at its core

scenic lotus
#

More parts and unionoperation can make the game laggy. Can use mesh

iron tundra
#

can anybody explain why this dosent work? ```local players = game:GetService("Players")
local badgeservice = game:GetService("BadgeService")
local textlabel = script.Parent
local badgeid = 716343469755606

local function checkforbadge(player)
local success, hasbadge = pcall(function()
return badgeservice:UserHasBadgeAsync(player.UserId, badgeid)
end)
if success and hasbadge then
script.Parent.Text = "yes"
end
end

checkforbadge()```

wind spindle
tame compass
scenic lotus
worldly sonnet
#

only the server

#

so you would have to fire a remote event

wind spindle
tame compass
#

that's why

wind spindle
#

the function needs a player

worldly sonnet
#

argument missing

wind spindle
# scenic lotus

I meant like, I have the properties tab open, but where are the properties you showed me? like are they in Teams or workspace Spawn Location?

wind spindle
#

Oh i see it now

#

I searched forcefield and it didnt show, had to search duration.

worldly sonnet
#

bro everytime i right click on studio it gives me these

#

when i hold it down to try and look around

#

its pissing me off so much

graceful scarab
#

lol

wind spindle
stone garden
#

wdym IsA("Tool")???

copper verge
#

We are a commission server so you can't buy or sell stuff here 👍

wind spindle
#

invetory

#

If they have a tool, which will be the gun or weapon, they force field gets destroyed

stone garden
hardy pilot
wind spindle
wind spindle
hardy pilot
#

What

#

🤔

stone garden
hardy pilot
wind spindle
#

are you talking about roblox's defualt forcefield system?

stone garden
# wind spindle ?

when you spawn, roblox give you a force field and roblox remouve it after 10 seconds, my question is why are you deleting it when roblox already doest it for you?

wind spindle
uneven turtle
#

Best way is to follow scripting tutorials and then make small projects. At the end you will master them at the same time because one needs the other most of the times.

sly plover
#

how to fix this

glad apex
autumn falcon
sly plover
autumn falcon
#

Why don’t you just copy paste the code into chatgpt

#

Also this is for discussion of code not for helping with code. If you want help debugging then you should go to #code-help

glad apex
tulip quiver
autumn falcon
#

Besides debugging isn’t learning lol

tulip quiver
tulip quiver
autumn falcon
somber vault
#

how does games that have more than 1 experience (say blox fruits for example) transfer the same data between the experiences

somber vault
#

which one?

gloomy trench
#

data store

#

service!

somber vault
#

that only works for the currect experience?

#

I'm using it for my experience

gloomy trench
#

every place instances

somber vault
#

but i don't think it shares the data

#

then supposedly i just call the datastore like how i normally would in the new experience, right? (with the same name)

somber vault
#

alright! trying that out

#

much appreciated!

sly plover
#

who can help me fix this

soft shoal
#

unrelated question - how much would you guys personally pay for a fully built and working, ready to use landing page which acctually looks good.

somber vault
patent gorge
#

Hey guys i need help yk how like games in line games where players move from one tile to another how do i do that but i lock the player's ability to move because when using :moveTo i would need to make the players walkspeed back to 16 then but when i do that i give the player ability to move using their keyboard/joystick os how do i use the :moveto but stop the player from using their movement

somber vault
#

to enable control again :
plr.DevComputerMovementMode = Enum.DevComputerMovementMode.UserChoice
plr.DevTouchMovementMode = Enum.DevTouchMovementMode.UserChoice

patent gorge
somber vault
#

other than making variables for plr, Humanoid, etc no

patent gorge
somber vault
#

anytime! i'll be waiting to hear the result

somber vault
#

along with freezing the RP but you wouldn't need that

patent gorge
#

would that mean i won't need to put the walkspeed back to 0?

somber vault
#

you won't need to change the speed

#

but it also makes you not able to jump

patent gorge
#

thanks you it works!

somber vault
#

anytime, if you need any help mention me and i'll do my best to help

oak verge
teal dawn
solid rain
#

have you tried reinstalling roblox studio

teal dawn
#

doin that rn

#

but the werid thing is thats the only game

stone garden
stone garden
teal dawn
solid rain
#

its most likely going to fix your problem

#

by reinstalling

teal dawn
#

alright

solid rain
#

something has gotten corrupted

teal dawn
#

most likely cause ive deleted alot from my downloads

solid rain
#

Oh now that I take a closer look at it that could also be a problem

#

idk how you managed to do that though

teal dawn
#

i was clearing up storage

#

and mass deleting things

#

that had no meaning

solid rain
#

do you code with github

#

and visual studio code

teal dawn
#

yeah

solid rain
#

i think thats the problem

teal dawn
#

oh it loaded a little but then died

solid rain
#

if you can makke the same path

#

and make the same file name

#

with hopes and dreams it should hopefully work

teal dawn
#

alrighty

#

nope thats not the problem

patent sonnet
#

Squid game

quaint furnace
#

boys i need to ask smth about datastore, if i fail to load data on entry (maybe table of items) and i save on playerleaving will it overwrite my previous inventory to basically nothing?

stuck egret
#

can somebody help when u click a part the game will remove item from your inventory

#

i didint understand what am i doing wrong

#

im kinda new to scripting

cedar flicker
#

Could be in your charachter already

#

Its only in your backpack if you dont have it equipped

teal dawn
stuck egret
#

okay

teal dawn
stone garden
teal dawn
drifting agate
quaint furnace
stuck egret
drifting agate
#

yeah it should work

drifting agate
drifting agate
#

alr well updateasync is a little better at least it prevents overwriting, just doesnt prevent writing nil

teal dawn
#

yeah, it just throws an error instead

#

or you could go through mnaually a table, if something is null just skip interly

stuck egret
drifting agate
#

did it error

stuck egret
#

no

somber vault
#

what's your issue

#

i might be able to help

stuck egret
somber vault
#

is the tool equipped when you remove it?

drifting agate
#

just try this and see what it prints

    print("clicked")
    if plr then
        print("player exists")
        local Keycard = plr.Backpack.Tool
        if Keycard then
            print("keycard exists")
            Keycard:Destroy()
            print("keycard destroyed")
        end
    end
end)
drifting agate
stuck egret
#

ohhh wait

#

i found the problem

somber vault
#

what was it

stuck egret
#

the code was in a localscriptcryingdead

drifting agate
#

would it not still work

stuck egret
#

its working fine now

#

thx for helping

somber vault
#

I'll do better next time

drifting agate
#

wait why doesnt it work on localscript

stuck egret
#

idk

#

i changed it to normal script

drifting agate
#

you can change that now

#

they updated it

somber vault
#

oh

#

my bad

drifting agate
#

run context

#

i saw it somewhere

stuck egret
#

i understand it now why i have to use normal script instead of local but its hard to explain

drifting agate
#

default is server

somber vault
#

it works in local?

#

game.Workspace.Part.ClickDetector.MouseClick:Connect(function(plr)
print("Clicked")
end)

stuck egret
#

yh but can u delete a item from your inventory?

somber vault
#

lemme try

drifting agate
#

i dont know why my studio doesnt have it but it looks like this

#

under script properties

#

oh wait u have to make a normal script

#

and then set the run context to client

somber vault
#

it does work

#

uploading a vid

drifting agate
#

where did u put the script under

somber vault
#

it doesn't work under the part though

somber vault
drifting agate
#

i figured it out

#

local scripts run automatically inside starterplayer and startercharacter

#

but if u put it under a part or something it doesnt run

patent gorge
#
            local hum = char and char:FindFirstChildOfClass("Humanoid")
            local root = char and char:FindFirstChild("HumanoidRootPart")

            if hum and root then
                local colorStr = tostring(survivorChoiceValue.Value)

                for _, spot in ipairs(workspace.Spots:GetChildren()) do
                    if spot:IsA("BasePart") and spot.Name == colorStr .. "Spot" then
                        hum:MoveTo(spot.Position)
                        hum.MoveToFinished:Wait()

                        local finalCFrame = CFrame.new(spot.Position + Vector3.new(0, 2, 0)) * CFrame.Angles(0, math.rad(90), 0)
                        char:PivotTo(finalCFrame)

                        print(currentSurvivor.Name .. " walked to " .. colorStr)
                    end
                end
            end

is there a reason why there is like a little delay before the move is done

drifting agate
#

u can instead create a normal script

somber vault
#

and GUIs as well

drifting agate
#

and then set the runcontext to client

#

and itll run

drifting agate
somber vault
drifting agate
#

i dont know why u cant set the run context on local scripts

patent gorge
somber vault
#

i don't see anything that delays the script but i'll try doing a modification

#

local hum = char:FindFirstChild("Humanoid")
local root = char:FindFirstChild("HumanoidRootPart")

        if hum and root then
            local colorStr = tostring(survivorChoiceValue.Value)

            for _, spot in pairs(workspace.Spots:GetChildren()) do
                if spot:IsA("BasePart") and spot.Name == colorStr .. "Spot" then
                    hum:MoveTo(spot.Position)
                    hum.MoveToFinished:Wait()

                    local finalCFrame = CFrame.new(spot.Position + Vector3.new(0, 2, 0)) * CFrame.Angles(0, math.rad(90), 0)
                    char:PivotTo(finalCFrame)

                    print(currentSurvivor.Name .. " walked to " .. colorStr)
                end
            end
        end
patent gorge
#

but ill have to check if i had paused the walkspeed

somber vault
#

good idea

drifting agate
#

print spot.position everytime and if its changing properly then the problem is with ur humanoid

somber vault
#

unless the spot's position is the same as the player's

patent gorge
#

anyways thank you!

somber vault
somber vault
patent gorge
somber vault
drifting agate
somber vault
drifting agate
#

maybe has to be subplaces

somber vault
#

it doesn't send the data that i have but rather sends a completely new one

somber vault
somber vault
#

i'm trying to send the data from the main experience to the round experience

drifting agate
#

couldnt you just use getasync

somber vault
drifting agate
#

whattt it should work as long as its under one experience

somber vault
teal quiver
somber vault
teal quiver
#

or whatever it was called

teal quiver
somber vault
#

that's for teleporting players themselves

#

not values

teal quiver
#

you can send values as well

little pebble
#

ANY PRO SCRIPTERS HELLO

somber vault
drifting agate
somber vault
tired rampart
#

Lf scripter company

teal quiver
heavy arch
teal quiver
#
-- Server
local teleportOptions = Instance.new("TeleportOptions")
local teleportData = {
    -- table with key/value pairs of userids and their data
}
teleportOptions:SetTeleportData(teleportData)
TeleportService:TeleportAsync(game.PlaceId, {player}, teleportOptions)

i modified this code slighly from the roblox documentation

#

dont mind that it is called {player} i forgot to change that

#

that could be an array of the players you want to send

somber vault
#

i found a solution

teal quiver
#

?

somber vault
#

--game 1 server script
game:GetService("TeleportService"):Teleport(GAME_ID, plr, TABLE)

#

--game 2 local script

local TS = game:GetService("TeleportService")
local plrdata = TS:GetLocalPlayerTeleportData()

local ValuesData = plrdata.Value

--fire the value

teal quiver
#

isnt that easily exploitable though

#

im assuming you are firing the value to the server from the localscript

#

@somber vault

somber vault
#

indeed, but i don't think they'll be able to find the values names except if an error message popped up

#

and i can cover that

teal quiver
#

just handle it from the server

#

the entire process

crimson plank
#

Guys

#

I learnt like all of the basic stuff for lua

#

How do I now go onto writing full frameworks in a good manner

#

Or just overall improving the quality

somber vault
#

if it's only for client

crimson plank
#

Vaaseo mind guiding me pls?

somber vault
#

okay so, all i have to say is start with simple stuff

#

such as flag capturing system, etc

#

once you're done with that level it up a notch

#

by making a level system for example

teal quiver
#

from the server

crimson plank
#

It’s just I can’t write good quality of code

#

Like my code seems makeshifts

#

And less optimised

#

Wanna improve on that

drifting agate
#

organize everything into module scripts

crimson plank
drifting agate
#

some ppl write all their code in module scripts and then just have one server script and one local script thats initiates those modules

somber vault
#

i personally use module scripts for repetitive functions.

drifting agate
#

or you can organize you code into modules in replicated storage, organize ur server scripts into serverscriptservice, and then organize local scripts in starter player and have the bulk of ur code in modules

crimson plank
#

I see

#

And about code optimisation do u need to learn use of actors?

#

@drifting agate @somber vault

hexed zinc
drifting agate
#

wdym by optimization like fps wise?

somber vault
#

i don't use it

crimson plank
#

So that includes decreasing loops

#

And heavy load functions

hexed zinc
crimson plank
#

Alr could u like give me some small easy task?

drifting agate
#

u can make ur code as modular as possible, that increases its quality

drifting agate
hexed zinc
crimson plank
#

Also do I use Roblox scripting system? Or do I use rust and shit

teal quiver
crimson plank
#

About exploits

#

A new script is coming

somber vault
#

yet

lone marsh
#

what we ta;=lking abt

crimson plank
somber vault
#

giving optimization tips mostly

crimson plank
#

Yuh

#

Does using a shit ton of ray cast cause performance issues?

teal quiver
somber vault
#

how ton are we talking

somber vault
#

if they're too many

somber vault
#

because in the end

#

they do execute a code if hit

crimson plank
#

How do u go about making a climbing system then?

somber vault
#

i use a loop which is even worse

crimson plank
#

Oh yuh using run service would be better

somber vault
#

i will show you a hitbox code of mine

#

that is similar to climbing

crimson plank
#

Alr bet

somber vault
#

task.spawn(function()
local con
con = game:GetService("RunService").Heartbeat:Connect(function()
if StopIT == false then
local hitbox = game.Workspace:GetPartBoundsInBox(base.CFrame, Vector3.new(8, 8, 20))
for _, char in pairs(hitbox) do
if SCRH.IsAPartOfChar(char) and not Climbing[SCRH.IsAPartOfChar(char)] then
Climbing[SCRH.IsAPartOfChar(char)] = true
if SCRH.IsAPartOfChar(char):FindFirstChild("Humanoid") then
--do the rest of the code
end
end
end
else
con:Disconnect()
con = nil
return
end
end)
end)

gloomy trench
#

guys is there a way to SYNC roblox studio scripts into rojo

somber vault
hexed zinc
#

wdym not inflict it

lone marsh
#

two way sync (experimental)

somber vault
#

the system has loops, etc. so i set every loop inside of a task.spawn to not delay/inflict with the other loop

#

even though runservice doesn't need one but i just put it there

#

forgot to remove it

crimson plank
#

Btw rojo better than Roblox scripting?

hexed zinc
#

i guess

#

id say thats probably not an ideal code structure though

crimson plank
#

What are the advantage’s

somber vault
hexed zinc
crimson plank
#

Hm

stiff ibex
#

hi chat

hexed zinc
#

boils down to whether you like it more or not lol

stiff ibex
hexed zinc
#

external editors generally have better plugins and support tools like darklua etc

lone marsh
somber vault
#

officially, i dunno if it's still beta or not

hexed zinc
#

what like an official integration plugin or somethin

lone marsh
hexed zinc
#

havent seen that

somber vault
#

a few weeks back or a month i guess

#

lemme find it

gloomy trench
somber vault
#

found out how, we're talking about syncing roblox studio script to VSC right?

gloomy trench
#

another one automatically cloning studio scripts instances into rojo

#

im lazy

somber vault
#

right click a script, select Sync to Disk...

#

rename the script to whatever you like

high plover
#

🎮 Roblox Full Game Developer - Efkan 🇹🇷
I develop full simulator/pvp/tycoon games from scratch inside Roblox Studio
and deliver them as a complete .rblx file.
While I don’t have a public showcase yet, I can build anything from UI to scripting to systems.
💰 Affordable | ⚡ Fast delivery | 💬 DM open for commissions!

somber vault
#

@hexed zinc

hexed zinc
#

ah yea

#

thats interesting

lone marsh
gloomy trench
hexed zinc
gloomy trench
#

is it possible

hexed zinc
#

tho its supposedly experimental

lone marsh
#

theres a rblxtorojo exe linked in the rojo documentation

hexed zinc
somber vault
#

just applied it now for showcase

crimson plank
#

Thnx for help all

somber vault
#

and there are these options when syncing

lone marsh
#

u gotta do each script manually?

somber vault
#

yeah.

lone marsh
#

damn that would be annoying

gloomy trench
#

cant believe i turned this chat into rojo

somber vault
lone marsh
#

ah

somber vault
#

like right now ;-;

#

😂

gloomy trench
#

me when i had 3 month experience and tried to sync rojo to game and did so badly

#

never organize your codes like this

#

stash all into a folder

somber vault
#

my old game's organization

#

i was terrible at organizing

#

and i don't want to even mention the replicated storage

#

ABSLOUTE MESS

#

thank god that i started a new project and learned to organize my stuff a while ago

somber vault
potent maple
#

Hello guys, since I'm new to scripting (I only know basics) I have question. I started from tycoon to learn smth new and improve skills. Should I put script inside each button (when pressed it will buy droppers etc) ?

scenic lotus
#

no

somber vault
#

better, optimized, easy to modify

scenic lotus
potent maple
somber vault
scenic lotus
#

can be like that

#

or use table to set price

somber vault
#

but you can also do that

potent maple
#

I can put prices in module script and then use require in serverscript, right?

somber vault
#

yep

#

would be better

#

and more organized as well

potent maple
somber vault
#

even though you can as well put it in the server script but you can put it in the module as well

potent maple
somber vault
#

a general tip, try to reduce as much instances in your game as you can

potent maple
#

module looks more ogranized

somber vault
static coral
somber vault
static coral
somber vault
somber vault
static coral
somber vault
#

SINCE WHEN

scenic lotus
#

If there're many game initialize modules then can use module loader for the intialize one

static coral
#

a few months ago if i am not mistaken

tired rampart
#

need a scripter for a company dm

static coral
scenic lotus
#

ye

somber vault
#

oh i didn't enable it

potent maple
#

Okay, another question. If I have more than two plots, how can I check which tycoon the player is trying to buy something from, and then clone the item from the correct plot in ServerStorage?

#

I can make different scripts as well, but it's easier to control everything in one script ig

somber vault
scenic lotus
#

Need to use some value to tell which owner of that plot or can just use team (like blue team, red team, etc . . .)

somber vault
#

you're talking about the property part or the tycoon part itself

potent maple
somber vault
potent maple
somber vault
#

and you can also check the touched part's parent from the server and submit that character as the owner

#

in a table

#

and make sure that a table called HasOwnedATycoon[character] ~= true or something

#

or you can use the first table and make a condition stating that the character must not be listed already

quick jolt
#

Guys, how much robux should A scripter get if he scripted a game very very similar to grow a garden, like almost the same thing

#

And the scripts are very very good

potent maple
# somber vault and make sure that a table called HasOwnedATycoon[character] ~= true or somethin...
local plot = game.Workspace.Plots.Capuchino
local claimPart = plot.Entrance.ClaimCapuchino
local owner = plot.Owner
local capuchinoTycoonStorage = game.ServerStorage.Capuchino

local debounce = false

claimPart.Touched:Connect(function(hit)
    if debounce then return end
    debounce = true
    
    local character = hit.Parent
    if not character then debounce = false return end
    
    local player = game.Players:GetPlayerFromCharacter(character)
    if not player then debounce = false return end
    
    if owner.Value ~= "" then
        warn("Capuchino Tycoon already claimed")
        return
    end
    
    owner.Value = player.Name
    print("Tycoon was claimed by", player)
    
    local capuchinoTeam = game.Teams.CapuchinoTeam
    if player.Name == owner.Value then
        player.Team = capuchinoTeam
    end
    
    local firstConveyor = capuchinoTycoonStorage.Buttons.Conveyor
    firstConveyor.Parent = plot.FirstFloor
end)

Why it's not assigning team?

somber vault
#

back

gloomy trench
#

i feel like zim

somber vault
#

what type of value

#

object, string?

potent maple
somber vault
#

btw that statement is useless

if player.Name == owner.Value then
    player.Team = capuchinoTeam
end
#

because the script will return if the owner isn't nil

#

and 1 major issue

somber vault
#

i'll give you a module script i made to check if it's an actual character or not

#

local module = {}

function module.IsAPartOfSpecificChar(part, char)
local parent = part.Parent

while parent and parent.Parent do
    if parent:FindFirstChild("Humanoid") and parent == char then
        return parent
    end
    parent = parent.Parent
end

return false

end

function module.IsAPartOfChar(part)
local parent = part.Parent

while parent and parent.Parent do
    if parent:FindFirstChild("Humanoid") and parent:GetAttribute("Player") == true then
        return parent
    end
    parent = parent.Parent
end

return false

end

return module

#

try it with these changes and let's hope that your problem gets fixed, as my prime suspect is the game considering any part with a parent an owner

unborn sable
#

how do ya'll learn how to script so well

#

swear tutorials ain't helping

coral field
#

practice

unborn sable
#

how long did it take ya'll to become fluent?

slender yew
#

I have an item that I want to place inside of a box, but I have to open the box so that the prompt to hide the item shows up
currently I need a way to turn on the UI after the box is opened and the player has the item, if the player opens the box and THEN gets the item, the ui doesnt enable because the script to enable it only runs when you open/close the box

I need a way to constantly check if the player has that item and if the box is opened.

somber vault
somber vault
summer matrix
#

yo

somber vault
#

you need time and patience

summer matrix
#

can anyone help me make abilities

somber vault
summer matrix
somber vault
#

tell me what do you want to make

summer matrix
somber vault
#

<3 anytime!

summer matrix
somber vault
#

sure

summer matrix
#

alright

somber vault
#

see if it changed

potent maple
somber vault
#

server script yes?

gloomy trench
potent maple
gloomy trench
#

i find it easier to learn other coding languages thanks to lua

hearty olive
#

Can you do print() in a module script right?

potent maple
somber vault
#

without the variable?

somber vault
hearty olive
potent maple
# somber vault without the variable?
local plot = game.Workspace.Plots.Capuchino
local claimPart = plot.Entrance.ClaimCapuchino
local owner = plot.Owner
local capuchinoTycoonStorage = game.ServerStorage.Capuchino

local debounce = false

claimPart.Touched:Connect(function(hit)
    if debounce then return end
    debounce = true
    
    local character = hit.Parent
    if not character then debounce = false return end
    
    local player = game.Players:GetPlayerFromCharacter(character)
    if not player then debounce = false return end
    
    if owner.Value ~= "" then
        warn("Capuchino Tycoon already claimed")
        return
    end
    
    owner.Value = player.Name
    print("Tycoon was claimed by", player)
    
    player.Team = game.Teams["CapuchinoTeam"]
    print("Team assigned")
    
    local firstConveyor = capuchinoTycoonStorage.Buttons.Conveyor
    firstConveyor.Parent = plot.FirstFloor
end)
potent maple
somber vault
potent maple
somber vault
#

okay, i'll try to replicate that effect on my game

sly plover
#

what is the problem

vocal trail
proper edge
#

if so then thats your problem

#

they're requiring recursively

hearty olive
#

Chat I just found the answer horray

sly plover
proper edge
sly plover
verbal lodge
#

anyone got some cool suggestions for features i should add to a security discord bot?

#

or features i should attempt to add

proper edge
#

the errors are usually above

nova yarrow
#

how do people learn to make stuff with alot of math like A* or Terrain Gen, i usually just copy other examples or code in diff langs and implement it in luau

sly plover
proper edge
sly plover
#

im new so still learning thanks for hgelping

nova yarrow
sly plover
somber vault
gray minnow
#

does anybody remember the function that generates random characters?

somber vault
sly plover
somber vault
sly plover
somber vault
#

learn theory and practice then you actually know how to make games

sly plover
potent maple
#
local plot = game.Workspace.Plots.Capuchino
local claimPart = plot.Entrance.ClaimCapuchino
local owner = plot.Owner
local capuchinoTycoonStorage = game.ServerStorage.Capuchino

local debounce = false

claimPart.Touched:Connect(function(hit)
    if debounce then return end
    debounce = true
    
    local character = hit.Parent
    if not character then debounce = false return end
    
    local player = game.Players:GetPlayerFromCharacter(character)
    if not player then debounce = false return end
    
    if owner.Value ~= "" then
        warn("Capuchino Tycoon already claimed")
        return
    end
    
    owner.Value = player.Name
    print("Tycoon was claimed by", player)
    
    player.Team = game.Teams["CapuchinoTeam"]
    print("Team assigned")
    
    local firstConveyor = capuchinoTycoonStorage.Buttons.Conveyor
    firstConveyor.Parent = plot.FirstFloor
end)

Why it's assigning CapuchinoTeam on player join?

stone garden
sullen fox
#

Or weighted chance tables

#

Either work

somber vault
sullen fox
#

Hit.Parent:FindFirstChild(“HumanoidRootPart”) I think i havent used it in a while

potent maple
potent maple
somber vault
stone garden
stone garden
somber vault
#

your character variable is hit.Parent

stone garden
# potent maple ```lua local plot = game.Workspace.Plots.Capuchino local claimPart = plot.Entran...

claimPart.Touched:Connect(function(hit)
if debounce then return end
debounce = true

local character = hit.Parent
if not character then debounce = false return end

local player = game.Players:GetPlayerFromCharacter(character)
if not player then debounce = false return end

if owner.Value ~= "" then
    warn("Capuchino Tycoon already claimed")
    debounce = false -- don't forget this
    return
end

owner.Value = player.Name
print("Tycoon was claimed by", player)

player.Team = game.Teams["CapuchinoTeam"]
print("Team assigned")

local firstConveyor = capuchinoTycoonStorage.Buttons.Conveyor
firstConveyor.Parent = plot.FirstFloor

debounce = false 

end)

somber vault
#

thats not it

stone garden
somber vault
#

hit.Parent can be literally anything

#

so the if statement doesnt do anything

potent maple
somber vault
#

dude

stone garden
somber vault
#

just because you named the variable "character" doesnt mean its always going to be a character

#

what youre doing is

stone garden
# somber vault dude

alr then add this lil piece of code for verification if not hit.Parent:FindFurstChild("Humanoid") then return end

somber vault
#

if hit.Parent doesnt exist then return end

#

so if a part touched it

stone garden
somber vault
#

hit.Parent could be workspace which isnt nil

stone garden
somber vault
#

im just saying

#

that character variable should be fixed

spark notch
#

Guys how much should the charge be to fix a knife that has been made entirely in local script s

sly plover
#

why is my local Workspace = game:GetService("Workspace")
not blue like the tutorial im following

spark estuary
#

probably

spark estuary
#

because there is a shortcut for game.Workspace - "workspace" and before it was "Workspace"

sly plover
spark estuary
wild fjord
#

:3

little pebble
#

any actual GOOD scripters

#

that knows what theyre doing

sly plover
sly plover
somber vault
autumn mirage
#

I need someone to make me a minecraft clone game

#

Or someone who can script the minecarts so it works like how it do in minecraft

somber vault
somber vault
#

one of my many projects was a minecraft-like game

#

@potent maple i'm really sorry for the delay

#

i tried it and it worked

somber vault
#

local plot = game.Workspace.Plots.Capuchino
local claimPart = plot.Entrance.ClaimCapuchino
local owner = plot.Owner
--local capuchinoTycoonStorage = game.ServerStorage.Capuchino

local debounce = false

claimPart.Touched:Connect(function(hit)
if debounce then return end
debounce = true

local character = hit.Parent
if not character then debounce = false return end

local player = game.Players:GetPlayerFromCharacter(character)
if not player then debounce = false return end

if owner.Value ~= "" then
    warn("Capuchino Tycoon already claimed")
    return
end

owner.Value = player.Name
print("Tycoon was claimed by", player)

player.Team = game.Teams["CapuchinoTeam"]
print("Team assigned")

--local firstConveyor = capuchinoTycoonStorage.Buttons.Conveyor
--firstConveyor.Parent = plot.FirstFloor

end)

somber vault
somber vault
#

so it's actually valid

spark notch
#

It's like 500 lines of code

somber vault
#

has an M1 system?

spark notch
#

Throw an d everythign main problem is it's completely local so others can't see it

somber vault
#

ik what client side is ;-;

spark notch
#

so how much

somber vault
#

it is actually NOT diffcult at all

spark notch
#

Would have to connect everything

somber vault
spark notch
#

how much u think

somber vault
#

animation in local

#

damage in server

#

welding + cloning + movement in server as well

somber vault
spark notch
#

Aight can u do it for me

somber vault
#

as the work is already done. you just gotta transfer it and change the only client variables if there's any

#

sure. dm

somber vault
potent maple
stone garden
#

I WANNA KILL MY SELF BRO, DO NOT EVER MAKE A PROFILESTORE EVER AGAIN DAWG

#

some values are there but i cant get thel or its fucking broken

static coral
stone garden
stone garden
static coral
#

just make your own datastore

#

profilestore just bloat

#

and that snippet alone looks like a crime against humanity

stone garden
static coral
stone garden
#

i also have a Channel Module that i made that redifines all communications

static coral
#

wtf

static coral
stone garden
static coral
#

seems kind of bloated

#

and maybe pointless

#

its not that deep to make chat system

#

unless you are adding some new functionalities and channels and stuff

stone garden
# static coral yeah

i do alot of verification client, server, i just have to require the module and check, the modules returns a callback itself, saves time

#

i m not making a remoteEvent everytime i do somthing

sudden bramble
stone garden
#

thats how i fire it, with only one function and no stress

static coral
stone garden
static coral
#

ohhh yes i understand

stone garden
#

can it returns a callback

static coral
#

i thought u meant chat system

stone garden
#

let me give you an example

stone garden
static coral
#

no i understand now

stone garden
static coral
#

yeah i have similiar project

digital canopy
stone garden
static coral
#

to centralize all server/client communication

stone garden
static coral
#

ye i see

stone garden
static coral
#

nah im good

#

i dont like using other people’s modules

stone garden
#

its 250 lines and readable

static coral
#

still

#

i dont want to use someone else’s code

#

i kid you not i have literally never used a free module/toolbox module

#

i have only looked at their source code for curiosity

stone garden
#

same, its scary

#

i m making a build battle game and my only local script is this

#

handle all my game

#

still working on it

compact spoke
#

i'm willing to put up with the bloat to avoid technical debt on my end and spending too much time focusing on things that are redundant

#

it's scary to use somebody else's code but it's scarier to write it yourself and have that burden be put 100% on you

#

especially when it comes to things that aren't as cut-and-dry

static coral
#

its better to have a burden on yourself once than to use some skidded shit that runs terribly and is horribly bloated with a bunch of bullshit

#

or code that is completely illegible that cannot be maintained

#

have u seen some of these signal modules

stone garden
static coral
#

they are tryna compete with assembly legibility or some shit

compact spoke
#

that's a good example actually because most signal modules are pointless imo

static coral
#

they are not pointless but a lot of them are just made horribly

verbal lodge
static coral
#

custom signals are actually faster and have better support than roblox signals

#

way better than having bindable event

compact spoke
#

@static coral they have their use cases but i find myself trying to steer away for two main reasons

  1. they're usually bloated
  2. there's 1,000 of them
static coral
#

thats why i made my own

compact spoke
#

the bloat is usually justified in the case of signal modules becuase they're always going to be faster than a bindable

#

but the latter is what kills it for me

#

like, go to the devforum and ctrl + f "signal" and you'll find probably over 2 dozen modules all claiming to be the fastest

#

and all of their benchmarks are against other different signal modules

somber vault
static coral
compact spoke
#

for me one of the only projects that i use extensively is bytenet for networking just becuase i like it, i know how it works, and i've been using it for a while

unborn sable
#

looking to create a game with somebody.

static coral
#

i literally have an entire game that is just a library for the modules i made for myself

#

whenever i make new project i can just paste all of them in

compact spoke
#

i mostly tend to do the same thing but in the end i usually just chop half of it out anyways

#

usually because i'm just not using most of it

#

and it's burning a hole in either serverscriptservice or repstorage

static coral
#

i just put the necessary things

#

i do some strange things so i often need unique functions or just weird shit in general so im always busy making utilities for myself

craggy plover
#

I dont have an idea for a small coding project to do to start my portfolio up, any ideas? not too complicated but not baby level

south sigil
#

Is here people from Poland?

sharp tangle
tacit swift
#

give me something cool to make, because im a new dev and i wanna learn!

things made :

1 - CountdownGUI

2 - Player Info

versed fossil
#

is there any way to not have hitboxes be insanely delayed? im making a dash thing with hitboxes and the hitboxes are a good 7 studs behind you when they generate.

slender yew
#

guys I became advanced in luau 7 months

junior glen
#

yo i get this error that i need to implement before run hook for security reasons in order for the commands to run i am using the cmdr module how to fix, i do have this module script inside SSS.Cmdr.Hooks.Permissions:

return function(registry)
    registry:RegisterHook("BeforeRun", function(context)
        local executor = context.Executor
        local userId = executor.UserId

        local groupId = 35920492
        local minRank = 254

        local isAdmin =
            userId == game.CreatorId or
            (executor:IsInGroup(groupId) and executor:GetRankInGroup(groupId) >= minRank)

        local isAdminCommand = context.Command.Group == "Admin"

        if isAdminCommand and not isAdmin then
            return false, "🚫 You do not have permission to use this command!"
        end

        return true
    end)
end
near pasture
nova yarrow
tacit swift
nova yarrow
#

Use AI to interpret it for u

tacit swift
#

alr

crimson plank
#

Uh brozy

#

could u help me?

autumn mirage
crimson plank
#

local Player = {}
Player.__index = Player

function Player.new(name)
local self = setmetatable({},Player)
self.name = name
self.score = 0
return self
end

function Player:incrementScore()
self.score += 1
end

local p1 = Player.new("Alex")
p1:incrementScore()
print(p1.name, p1.score)
I dont understand what player.__index = Player does

tacit swift
#

ok?

crimson plank
#

could u explain?

tacit swift
crimson plank
nova yarrow
cedar flicker
#

No

tacit swift
#

...

#

thats all i know

cedar flicker
#

You need to look up what index does

crimson plank
#

Thats what I did

#

Look inside p1 for a function called incrementScore

If not found, check the metatable

If __index is set, check that table for the function
this is what I found

cedar flicker
#

Its defining what happens when youre looking for a item that dsoent exist

#

Yes

cedar flicker
#

I meant that as "Yes, you're right"

#

With your definitoon

#

definition

#

the official lua docs explain this best

nova yarrow
nova yarrow
# crimson plank hm

If u look for a value in table and it's not there it searches for the backup

cedar flicker
#

The music 😂

karmic mango
#

what is even the point of jump property in humanoid

tacit swift
#

ye iam sending a new one...

tacit swift
#

its just a gui that counts how many time you have jumped

near pasture
karmic mango
tacit swift
#

fr

karmic mango
#

unless theres a secret event for it which i just didnt know about

twin mesa
#

i see some ppl using VS for scripting in roblox, should i do it or just stick with roblox studio?

tacit swift
#

is this cool....?

twin mesa
tacit swift
#

idk tbh...

twin mesa
#

so just for the love of the game?

tacit swift
#

ive just used it for html, css, and js

twin mesa
#

thats fair

elfin timber
#

whats the best way to implement a cap on something

crimson plank
#

local Pet = {}
Pet.__index = Pet

function Pet.new(name)
local self = setmetatable({}, Pet)
self.name = name
self.hunger = 100
return self
end

function Pet:Feed()
self.hunger = 0
print(self.name.."HungerLevel="..self.hunger)
end

function Pet:Talk()
print(self.name.."barked")
end

local P1 = Pet.new("Dog")
P1:Feed()
P1:Talk()

Ok I m kinda understanding this

elfin timber
#

so lets say i have a farming game and i want the max in somebodies backpack to be 100 fruits crops whatever

elfin timber
#

i cant find any

cedar flicker
#

A bit more "complex" workflow with syncing rojo with studio

#

But overall nothing bad, really great tool

#

Scripting in studio is fine tough

#

The native "version control" roblox has is dogshit

crimson plank
#

I understood metatables finally

#

local Pet = {}
Pet.__index = Pet

function Pet.new(name)
local self = setmetatable({}, Pet)
self.name = name
self.hunger = 100
return self
end

function Pet:Feed()
self.hunger = 0
print(self.name.."HungerLevel="..self.hunger)
end

function Pet:Talk()
print(self.name.."barked")
end

local Dog = setmetatable({},{__index = Pet})
Dog.__index = Dog

function Dog.new(name)
local self = setmetatable({},Dog)
self.name = name
self.hunger = 100
return self
end

function Dog:Trick()
print(self.name.."rolled over")
end

local d = Dog.new("richy")
d:Feed()
d:Talk()
d:Trick()

fair shoal
#

its already like perfect basically

stone garden
twin mesa
#

so ig i shouldnt mind switching to it

twin mesa
fair shoal
#

by uh whats his name

#

oh wait thats profilestore

#

thats the old version

pseudo maple
#

What course do yall recommend i buy?

cedar flicker
#

imo version control is still useful for solo devs

#

Not necessarily pre game release

#

But post release its gonna be a life saver

twin mesa
cedar flicker
#

No vs code is just your editor haha

twin mesa
#

oh

cedar flicker
#

Git could make it easier

twin mesa
#

oh alr

#

thanks

cedar flicker
#

Thats not roblox specific btw, i wouldnt mind all this when youre just starting out itll just overwhelm you

slender yew
#

can someone link me a good tut for making mobile/console controls?

#

mainly mobile

wind spindle
#

Are you brand new?

lean ocean
#

waste of money

slender salmon
#

does anyone know why Cmdr just stopped working in my studio 💀

slender salmon
#

0 errors

hoary cedar
slender salmon
#

it handles normal commands fine but not my custom ones

slender salmon
#

it just like doesnt register my custom commnads in studio but works fine in a actual game

hoary cedar
#

Share your screen

slender salmon
#

i kinda cant

#

cause of the game im working on

#

💀

#

ill figure it out just wondering if it was like a general error

hoary cedar
#

Show your registration code

slender salmon
#

wdym

hoary cedar
#

Cmdr requires you to register custom commands to its system

slender salmon
# hoary cedar Cmdr requires you to register custom commands to its system

oh its just this bro 💀

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cmdr = require(ReplicatedStorage.Game.Utility.Moderation.Cmdr)

local Commands = script.Parent.Commands
local Hooks = script.Parent.Hooks
local Types = script.Parent.Types

Cmdr:RegisterDefaultCommands()
Cmdr:RegisterCommandsIn(Commands)
Cmdr:RegisterHooksIn(Hooks)
Cmdr:RegisterTypesIn(Types)```
slender salmon
#

just weird tho cause it was working perfect and i didnt change any code

pseudo maple
pseudo maple
limber plank
#

can anyone help me setup the effect that i already got and just put on the character like sol rng?

wind spindle
#

it's way more useful and fastere

pseudo maple
wind spindle
#

It sticks in your mind

#

or use a model from the toolbox

limber plank
#

can anyone help me setup the effect that i already got and just put on the character like sol rng?

twin mesa
velvet meadow
#

could be better?

gray junco
#

You don't need tô declare the player inside the function

#

Declare it outside , and for most of the cases, the character and the humanoid root part

#

Where is your script located?

burnt pulsar
#

hello guys i was wondering how does games like grow a garden saves player inventory??

burnt pulsar
shrewd meteor
#

does anyone have a script to get avatar robux value of player

cedar flicker
reef birch
real zealot
violet folio
rain osprey
#

code help sucks so im asking here

#

btw fontbuf is just my wrapper for the buffer library with a cursor added

fleet siren
#

Why is my profilestore not making leaderstats?

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")

-- ProfileStore
local ProfileStore = require(ServerScriptService.ProfileStore)

local function GetStoreName()
    return RunService:IsStudio() and "Test" or "Live" 
end

local Template = require(ServerScriptService.Data.Template)
local DataManager  = require(ServerScriptService.Data.DataManager)

-- Access ProfileStore
local PlayerDataStore = ProfileStore.New(GetStoreName(), Template)

-- Add leaderstats and syncronize player data
local function Initialize(player: Player, profile: typeof(PlayerDataStore:StartSessionAsync()))
    -- Leaderstats
    
    local Leaderstats = Instance.new("Folder")
    Leaderstats.Parent = player
    Leaderstats.Name = "leaderstats"
    
    local Cash = Instance.new("IntValue")
    Cash.Parent = Leaderstats
    Cash.Name = "Cash"
    Cash.Value = profile.Data.Cash
    
    -- Sync PlayerData
    ReplicatedStorage.UpdateCash:FireClient(player, profile.Data.Cash)
end
#
-- Creates and stores profile
local function PlayerAdded(player: Player)
    local Profile = PlayerDataStore:StartSessionAsync("Player_" .. player.UserId, {
        Cancel = function()
            return player.Parent ~= Players
        end,
    })

    if Profile ~= nil then
        
        Profile:AddUserId(player.UserId)
        Profile:Reconcile()
        
        Profile:OnSessionEnd(function()
            DataManager.Profiles[player] = nil
            player:Kick("Data error occured. Please rejoin.")
        end)

        -- save profiles for later use
        if player.Parent == Players then
            
            DataManager.Profiles[player] = Profile
            Initialize(player, Profile)
            
        else
            Profile:EndSession()
        end
    else
        player:Kick("Data error occured. Please rejoin.")
    end

end

-- Early joiners

for _, player in Players:GetPlayers() do
    task.spawn(PlayerAdded, player)
end
Players.PlayerAdded:Connect(PlayerAdded()) 

Players.PlayerRemoving:Connect(function(player)
    local Profile = DataManager.Profiles[player]
    if not Profile then return end
        Profile:EndSession()
        DataManager.Profiles[player] = nil
end)
#

I had to split the message up cus discord msg limit

fleet siren
mint cloud
#

WE are ignoring both of u

reef birch
fleet siren
# reef birch did you write this or did chatgpt

You need to be using ProfileStore in all of your Roblox gamedev projects! In this tutorial, we learn why it's better than default Data Stores and how to set it up. No sweat!

Thanks for watching! I'm a Roblox game developer teaching Roblox players how to create their own games. Subscribe to learn more!

Download ProfileStore:
https://create.robl...

▶ Play video
#

This

#

I followed this

#

idk if i missed something

#

When I load game leaderstats just dont work

#

and i get this error

reef birch
#

do you know what the script does

fleet siren
reef birch
#

what does the colon do

#

i think youre looking it up right now
you should ask the person who wrote the script why it wont work

fleet siren
#

after i fix one its another

#

i think i just missed some detailes

violet folio
alpine storm
#

hey could someone explain the difference between: Scripts,local Scipts and Module Scripts?

near sonnet
alpine storm
#

sever is the roblox place

#

client is the game running on persons device

lost yoke
#

nope > says the difference

near sonnet
#

lol

#

yeah thats pretty much the difference

#

server is where every player is on and client is the game on one device of a player

#

so

#

scripts are for actions for the whole server so for every player

#

local scripts are ment for the client so on speciffic players or one player on its own

fathom sundial
#

who ordered a yappuchino

near sonnet
#

he asked

fathom sundial
#

is that rufus

near sonnet
#

it is

fathom sundial
#

i was kidding i love you

near sonnet
#

xD

fathom sundial
#

take back everything i said

lost yoke
near sonnet
#

and a module script in Roblox is a special script used to store reusable code like functions or variables.

alpine storm
#

so local scripts can get exploited

#

what about the normal script function

#

and the modulus one

alpine storm
#

i see

#

what abt the normal non-local and non-module

remote bear
#

i have been using string keys for fast table lookups but i think its also taking up a lot of Cpu usage what could i use instead

remote bear
gusty schooner
remote bear
gusty schooner
#

Im missing something

remote bear
gusty schooner
remote bear
gusty schooner
remote bear
gusty schooner
#

I suggest either use vectors serialized to buffers as keys or have a structure of sub arrays per chunk and axis

remote bear
gusty schooner
remote bear
remote bear
gusty schooner
#

Also thats really fire

remote bear
gusty schooner
sly axle
remote bear
gusty schooner
languid harbor
#

Im level five but i cant send gifs?

remote bear
# gusty schooner Do u mean communicating between actors?

kind of since for it to work (for the buffer writing) i would need to make it create a new buffer that fills in a section of it and then combine them all to create the final display buffer. i am sure there is a better way of doing this but i am not sure

gusty schooner
# remote bear kind of since for it to work (for the buffer writing) i would need to make it c...

I havent used actors before making this chunkloader but basically what i did was gather chunks and split them across a amount of actors which will start their parallel connections when the chunks get sent, then every frame i do everything as efficiently as possible. Stuff such as the parent of an object have to be written in serial so what i initially did was in my for loop every time run the parenting in serial and make it parallel again, however i doubled the peformance by making a parenting queu so i made an array of chunks that had to be parented to their original parent or nil and then after that i loop thru the queus and parented them

#

Holy yappachino i know

#

For me it was really the order of doing things, i dont think it will be a problem sending a message to an actor often because they are made for it

remote bear
# gusty schooner I havent used actors before making this chunkloader but basically what i did was...

yeah i am just not sure how i could use actors in my time line since i am translating a bunch of tables into one display buffer that contains 700 triangles so no matter how many blocks are on screen only 700 are displayed although the rewrites are around triple. this was to fix some common visual bugs i got when displaying things on canvas draw 3.4.1 (an older version compared to v4+). so the only way i can see myself using actors is if i used multiple display buffers one for each actor and i assign chunks to write then display them one after the other but then there are other issues with that like how do i know witch block should be rendered in witch actor and in what order should i display them etc

gusty schooner
#

Then just connect to prerender in parallel and do ur render code for the assigned blocks

#

I go to sleep now, i hope i helped 😃

remote bear
solemn latch
#

Hello, I was wondering if anyone had suggestions on the best way to learn scripting. I've tried tutorials but I find myself still not fully understanding. any suggestions would be appreciated!

lost yoke
#

make a game to learn not learn to make a game

solemn latch
#

so like a mini game to use what you learned?

lost yoke
#

pretty much yeah start with something simple

#

then you get set yourself on more complex goals

solemn latch
#

okay thanks, do you have any small minigame suggestions? idrk what to work on rn

lost yoke
#

hmm

#

try making a start menu for your game

#

u dont really need to know anything to do that so its a good starting point since pretty much every game needs one and you can always make it more complex later on

solemn latch
#

okay thank you!!

nova yarrow
#

I made terrain gen a while ago with chunks, im planning on making it in parallel since it was recommended to me

blissful ruin
#

so yall - lua local currentPivot = AirPlane:GetPivot() local planeRight = currentPivot.RightVector local worldUp = Vector3.new(0, 1, 0) local rollDirection = planeRight:Dot(worldUp) < 0 and -1 or 1 tspmo, like if the plane goes full 180 roll then it will have the roll direction flip to keep the airplane fully flipped 180, is there any other solutions or something, ive tried so much stuff and none worked.

sour rock
#

pastebin.com/hckec5S
weird thing, flight works on the local host studio sesh, but when i go to live ops, it stops working. any possible fixes?

#

^^ link not clickable since HD bot would remove it

somber vault
velvet meadow
ivory folio
pure flame
#

is this a bad way to store the access codes (the index is a placeholder)

dense oasis
#

Any good projects I should do for my portfolio got a placement system with saving rn

gaunt trout
#

let me get hired for something not gui related🙏

dense oasis
crimson plank
#

region better than using a physical hitbox?

chilly timber
#

can someone help me real fast

crimson plank
chilly timber
crimson plank
#

I cant help without looking at the code

chilly timber
chilly timber
somber vault
#

@autumn mirage DM