#code-discussion
1 messages ยท Page 17 of 1
fr
But not for knockback
gotta try it out
pretty sure replicating to the client and giving network ownership is the best way
It'd be pretty iffy for knockback
you have to replicate anyways so
Since you'd lose all control
for effects
as well get knocked not in a direction but to a position
Yeah but how do you replicate this
@hollow steeple your dms are off. we cant message you for work please open them
Check his profile
i thought smh about applying the bodymover to the victim client then simulating on other clients with tween but that would probably suck
1 sec bro
1
let me just test in a baseplate
Out of time 
i did a slam moveset the other day and i had to resort to localized replication
with a sanity check
to sync the slam effects up
because of ping
what is sharkbite games
what is his roblox user btw
Localized replication?
server > play on client > client sends 'finished' to server > server replicates to other players
with a temporary queue
and a 3 second sanity check to ensure that the player doesnt block the damage remote incase of a cheater
@indigo flame are u sure its choppy?
im testing in 2 player test to double check
ah i see
yeah
yea i saw
smooth for only one player right?
yea
i saw a solution was to replicate it to each client in the game
but maybe you can try non-force movement
if you give the networkship of the victim root to the attacker then its only smooth for the attacker
i think it has to do smth with non force, but when u tween the victims client its still choppy for others if you do not replicate somehow
no tween
spring bro
also animations i know are smooth
so you might wanna look int othat
spring as in the spring constraint?
yeah but anims do not move the rootpart but i guess you can move it manually
nono
a spring movement module
like
update the cframe on stepped/renderstepped
with a spring
oh right i saw that being used somewhere but why spring isnt kb kinda just linear
i mean depends on the
i mean you can also make it linear
but i feel like you will need to be do cframe updating
for knockback
i guess, but i'd also need raycasting in case the player is in a corner or a wall cfame will just clip them thru
im trying to think of a solution it cannot be that difficult lol
i know god its been done already in most games but i can't think of a good one
have you tried removing mass btw
of the character
and using unreliables alongside regular remotes
i have a part that is supposed to give u 1 coin every time u touch it ive tried evrything even using remote events and functions to just legit making the part give u one value when touched on the local side how can i do this i am confused rn
nope ill do some testing with those
does anyone know how I could handle ore spawning in my game for mining like pet sim 99 does like how do they generate or spawns? i thought of generating random spots in a area and then using bound box on them to check if htere is any ores nearby but how often could I do this to not cause any performance issues, so do I use bound box or magnitude checks and generate a random pos on the area?
can someone help me make a script?
question pls, i tried changing the property of the camera but it doesnt work. Any idea how i could reference the players camera using a script (that is not local script).
Handle the touch on the server, increment the hits parents stat
Can someone help me fix a script
Can someone help with ProfileSerivce, I lost all ideas how to fix it XD
never turn on new type solver on studio beta
send code here
does touchpan ignore gameprocessed? because even if i check for it, when i move over the thumbstick; it moves my camera while it should be blocking it
use remote event to tell the client to do something with camera

???โฆ #marketplace-info
Can u explain further?
Got it! Thanks ToS
can someone help i need a local script in starterplayerscripts to check the players leaderstats to see what stage the player is on and if the player is on stage 20 it disables scripts in some gui buttons
Why is PathfindingService so annoying
I'm going to snap necks if it isn't updated soon
does anyone recommend use script sync? programming with vsc in roblox
For my ore spawning system in a certain area. Do I use the models extent sizes to do magnitude checks? + some extra distance and how many times should I run the function, before I time out for a certain time if the area is full.
lf someone who can make a game icon/thumbnail dm me fast
use rojo if you're not team creating, otherwise use the script sync functionality i don't know how well it works now
is there a way to make a hit box that could always be on the floor no matter the elevation changes?
do you think rojo is that good to use, some says that its good some people says that its overkill and studio is already enough for coding
i don't think studios workflow is good enough but depends what do you want
vscode extensions are nice and you have an lsp so you're not missing out
ok thanks, i'll just try it and see by my self
how does a m1 system work? does it just detect each m1 in a certain time period and link a animation to that click or?
basic example is to make a local script and fire a remote every m1 and handle that on a server script
hm alr
For my ore spawning system in a certain area. Do I use the models extent sizes to do magnitude checks? + some extra distance and how many times should I run the function, before I time out for a certain time if the area is full.
yo
anyone knows how to send the accesscode from reserveserver() to other servers through messagingservice
Does it make a difference to use module scripts to save global tables, instead of just doing "_G.PlayerData = DataTable"?
Global variables don't work on client and server like modules do, they're also really old and are slower than modules, like _G.PlayerData in a localscript will only work in other localscripts
Well yeah I don't really need more than that. I used _G for a previous game I made and it got a couple M visits and I never had a problem with it. But people told me it's not good to use it hence why I am asking
I don't see a problem with using it if it works
that's what I am saying
Sorry if this sounds dumb but what is meant by libraries in programming?
region = region:ExpandToGrid(1)
local partsInRegion = workspace:FindPartsInRegion3(region,"shitwewillexclude", 1)
if #partsInRegion > 0 then
for _, part in ipairs(partsInRegion) do
print("Part blocking area:", part.Name, part.Position)
end
end
how can we make it so that shitwewillexclude is not one object but a list? Somebody said overlap parameters but I didnt understand how to use it so Im looking for a diferent advice
is there a way to change a parts velocity even if it is the primarypart of a model and is welded with other parts?
hello everyone
my page build and deployment workflows keep on failing, why is this?
has improved a lot, only thing is better rollbacking and commit history
yeah its more about the code editor than the workflow i'd use neovim if studio was stable on linux
is upladoing animations down
Current system status. View active incidents or upcoming maintenances. Subscribe to receive status notifications.
I don't want to go back there gang
lol
Ive decided to not fix it
pass the code
until a bigger issue appears
ok
mess around with filtertype
Im gonna sweep my issues under the rug till the rug is no longer holding it back
hmmm
a very poor way to deal with issues
nahh that wont cut it
but what if it doesnt cause problems
what if
how can I make an if statement that is like:
If the array has elements in it return false
maybe #array > 0?
yo waitt hold on chat did I cook
if array: return False
This means if the list is not empty (has elements), it returns False. If it's empty, the if statement doesn't execute, and you can handle that case separately.
so like what are you trying to do
in python that is
my way works too tho right? Atleast it worked in my script
I have spawn areas for objects to spawn. I create zones around the objects Im trying to create to check for stuff like trees. If the zone is colliding with a tree it prevents the object from spawning
if #array > 0 then
return false
end
this is how u do it in lua
yh did that
๐
on gang chatgpt is not useful I learned more trying to correct what chatgpt does wrong than any other method
docs?
documentation
oh so reading basicly
chatgpt once suggested i take my vfx script to server to "reduce strain" on client ๐ญ
chatgpt is extremely ass but because I paid 20 dollars for it I use it. Because I use it I learn throughout the process of fixing its mistakes
wow u actually paid for the subscription
you could also go roblox dev forums
never had a reason to lol
anyone want a mod for his roblox game im free of charge
I don't want to create threads because I generally can solve the issue after a while of thinking
my friend said its worth it so I said why not
๐
no i mean looking through past threads to see if someone else had a similar issue
anyone want a mod for his game im free of charge?
u might wanna try claude 3.7
local function createPart(properties, i)
local newPart = Instance.new("Part", spawnArea)
for key, value in pairs(properties) do
newPart[key] = value
end
newPart.Position = Vector3.new(randomPosition(newPart, i))
print(newPart.Position)
newPart.Name = "Part " .. i
local cd = Instance.new("ClickDetector", newPart)
return newPart
end
```currently the zone detection script I have returns false if the zone is not empty. When false is returned for RandomPosition and the newPart.Position is printed it is printed as 0,0,0. How can I make it so that if randomPosition returns false, the script tries it again
its free and its one of the best AIs for scripting atleast out of all of the ones ive tested
like it will constantly try until it finds a place.
but then again, it can really only make stuff that a 2 week scripter could make tbh.
so no one wants a free mod?
what in minecraft
yhh tbh I use chatgpt mostly to remember ways on how to do stuff. Like I can forget to use an array here or there and chatgpt reminds me of it
how big is the game
@sacred prairie can u help me with it?
bro you misunderstood me
ok
i wanna be a mod
oh
for a game
im investigating the issue
bro u dont even need any experience in anything to do that
ik
alr then so which game is it
scripting isnt about memory
for postion, attempts, and maxAttempts
its about understanding, then the memory naturally comes.
local function createPart(properties, i)
local newPart = Instance.new("Part", spawnArea)
for key, value in pairs(properties) do
newPart[key] = value
end
local position
local attempts = 0
local maxAttempts = 100
repeat
local temp = randomPosition(newPart, i)
attempts = attempts + 1
if attempts > maxAttempts then
error("Could not find a valid position after " .. maxAttempts .. " attempts.")
end
if type(temp) == "table" and not (temp.x == 0 and temp.y == 0 and temp.z == 0) then
position = Vector3.new(temp)
break
end
until false
newPart.position = position
print(newPart.position)
newPart.Name = "Part " .. i
local cd = Instance.new("ClickDetector", newPart)
return newPart
end
oh yeah and just script more often and it will naturally stick
ok wait real quick
so I did a print(randomPosition(newPart, i)) and it returned false as expecte
cant we make it so that if it equals to false it does something
in this case attempts
or am I pulling a yandereDev rn
Thanks, I watched 8 videos and i understand almost everything from them except "return" 
since the print(randomPosition(newPart, i))
confirms randomPostion returns false, when it fails
right?are u following?
where's the guy im talking to
are u following?
yeah
exactly. so
I had to check something
we can tweak the createPart function
to retry specifically
when it returns false
yeah I tried to implement it
so that u don't have to check for a table with 0,0,0 coordinates
how do i become a moderator for roblox games?
lemme edit it real quick
maybe if we use a repeat until?
local function createPart(properties, i)
local newPart = Instance.new("Part", spawnArea)
for key, value in pairs(properties) do
newPart[key] = value
end
local position
local attempts = 0
local maxAttempts = 100
repeat
local temp = randomPosition(newPart, i)
attempts = attempts + 1
if attempts > maxAttempts then
error("Could not find a valid position after " .. maxAttempts .. " attempts.")
end
if temp ~= false then -- If not false, assume itโs a valid position
position = Vector3.new(temp)
break
end
until false
newPart.Position = position
print(newPart.Position)
newPart.Name = "Part " .. i
local cd = Instance.new("ClickDetector", newPart)
return newPart
end
the loop repeats
like it keeps running
if temp == false
when randomPosition returns anything other than false
shouldnt we make it until true?
, we assume its a valid position
oh wait
loop
if the placing fails it returns false
so shouldnt we make the loop break when we get a valid position?
like shoudlnt the loop continiue as long as we are getting false
u could actually use repeat-until true
since it aligns well
the other one prob could have made it to run indefinitely
also we didnt make local position equal to anything
cant we make an elif for nil specifically
like else if position nil do something
well
since randomPosition
returns false when the zone is not empty
it might also return nil in other failure cases
like an error in its logic
but adding an elif statement
is a good way
to make the script more yk
robust
thomas shelby
there is no equal sign after local position
๐
to assign it to anything
what do you want to assign it to?
should I just make it 0,0,0
oh can I just declare it without any assignings?
yeah, or just assign what position u want
dangg bruh this is crazy
what's the matter?
learning you can just declare variables was a mindblowing information
lol
it defaults to nil
when u dont assign
something to it though
looking for scripters to work on a cashgrab game, Im paying with game revenue, DM me
never thought i would hear this
Bro, wait till you learn about implicit type conversions ๐
lol
we got some problems
?
let me send a video
ur portfolio does not work does it?
Huh
That is strange
the issue is firstly objects are weird as hell. Their positioning has a problem with the y axis probably
also when I click on a part it shows a few blue areas yk
ok so
the a few blue parts thing is related to the Zones which I use for area control
everytime random position runs a new zone is made
the video isnt loading for some weird reason
and because we run it a few times we have a few zones
I think we can remove the zones during the loop and just fix it
u have the game revenue or do u mean %?
sure
%
๐ฎโ๐จ
ideas?
ok rain we have a lot of issues actually but I will try to fix it myself first. I will lyk
ok
im pretty sure theres a channel for hiring scripters
lol
who put the nerd emoji ๐ญ
I always get denied there
nah fr
how do you get denied
have you made other projects befor?
Probably
i meant released games with any sort of profit
me
ok
DM me
use ai ๐ญ
who here knows OOP looking for comm work
yeah my dumbass just had a name that roblox didnt allow
ty tho
@sacred prairie I made it bruh๐ญ sort of at least
--this is to destroy the zones if a placement fails:
if #emptyZone > 0 then
print("Zone " .. zones.Name .. " found error")
zones:Destroy()
return false
end
-- this is to repeat placement until the position is not 0,0,0 (because if it returns false, the position is defaulted to 0,0,0)
repeat
local tempx, tempy, tempz = randomPosition(newPart, i)
print(tempx, tempy, tempz)
wait(1)
newPart.Position = Vector3.new(tempx, tempy, tempz)
until newPart.Position ~= Vector3.new(0,0,0)
```currently the script doesnt rlly have a solution to nil returns (If randomPosition returns nil will the position default back to 0,0,0? because if yes then everything is fine)
Also the script currently works like this: The part is placed, it got in contact, it is sent to (0,0,0), its zone backtrack is deleted, a new zone is created in a new position, the part is sent to that position.
Also the after fail placements are being made one by one. Lets say part 2 and 3 failed to place:
Part 1,4 and 5 load automatically at the start because they didnt fail. First 2 will undergo the process and when a suitable spot is find for part2 part 3 will begin. Maybe I can use taskspawn though
Lmfao
atleast ur honest
I'm looking for the best way / best practice to store and sync cooldowns for my abilities. I saw this tutorial, I learned a lot. But I still have some questions.
His final solution seems to be bad, someone commented to do this instead.
-- Module script
local module = {}
module.Actions = {
Cooldown = 1
}
module.SkillMoves = {
Test = {Duration = 3}
}
-- Server script
local started = workspace:GetServerTimeNow()
remote:FireClient(player, {module.Actions.Cooldown, started, "Test"})
-- Client script
remote.OnClientEvent:Connect(function(content)
local action = content[1]
if action == module.Actions.Cooldown then
local started, skillName = table.unpack(content, 2)
local skillInformation = module.SkillMoves[skillName]
local textlabel = ... -- create a textlabel to visualize cooldown
local c
c = RunService.heartbeat:Connect(function()
local remaining = math.floor(skillInformation.Duration-(workspace:GetServerTimeNow()-started))
textlabel.Text = `{skillName} {remaining}`
if remaining <= 0 then
c:Disconnect()
c = nil
textlabel:Destroy()
textlabel = nil
end
end)
end
end)
Is this the right way to do it?
local function abc()
def.OnServerEvent:Connect(function()
-- stop the abc function. how????????
end)
end
that is garbage and exploitable
local function abc()
def.OnServerEvent:Connect(function()
-- stop the abc function. how????????
end)
end
lmfao
theres nothing there to exploit
๐ญ
do something like this
local CoolDowns = {
Test = 0,
}
local CDDuration = {
Test = 3
}
remote.OnClientEvent:Connect(function(action)
--Assuming action = Test
if time() - CoolDowns[action] > CDDuration[action] then --Still on cooldown
return
end
CoolDowns[action] = time()
--Do the action
end
this?
oh u were talking ab the other one
what how would that be exploitable
show the code ur trying to implement
Can u elaborate why it's better?
People recommend os.time() and time() functions should be avoided
I cant post links
What about tick?
are u trying to store the cooldown in datastore
devforum roblox com /t/how-to-actually-sync-cooldowns-between-server-and-client/2661854
No, it can be handled by the server & client
it depends on what ur trying to do
no code. i literally just want to make a nested function end the outer function...
Basically, I want a modular way to be able to handle cooldowns for the player. I have abilities and gun cooldowns. Basically I just want PLAYER, ABILITY combination with a cooldown
time is basically the amount in seconds since the server started/client started (i think)
os.time is the amount of seconds passed since some day in 1970 or some shit
or am i getting mixed up idk
Why is it so difficult to find good / best practices for this btw? Every server, every channel, everyone I ask has different answers.
Everyone disagrees to the best ways to do it
because it depends on what ur doing
if u want to sync between server-client then u can use Workspace:GetServerTimeNow()
but if ur just doing cooldowns on the server u can just use time
local function abc()
def.OnServerEvent:Connect(function()
-- stop the abc function. how????????
end)
end
how can i end the outer function using the nested function?
Yes, this most likely
I think I'll use this three-way script I made now.
do u need a cooldown timer on the client?
tbh what I would do is make a module script in SSS. Acces it from serverscript for cooldown checks. Also put the same cooldown values on a local script (U cant access modules from local scripts directly but just use same values). If an exploiter bypasses the local script cooldowns the server will not process their skills and ability usages between cooldowns anyways
why would u even want to do this
Yes, at least at the start. I want to make some sort of energy bar that activates after activating the ability.
Hmm, take a look at this
i am new to scripting. i tried to make part that kills. why this no work?? local script = script.Parent
script.Touched:Connect(function(hit)
if hit.parent:findfirstchild("humanoid") then
hit.parent.humanoid.health = 0
end
end)
local module = {}
module.Actions = {
StartCooldown = "StartCooldown",
EndCooldown = "EndCooldown"
}
module.SkillMoves = {
Fireball = { Duration = 5 },
Heal = { Duration = 10 },
Dash = { Duration = 3 }
}
return module
@rotund cedar @buoyant ice
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local CooldownEvent = ReplicatedStorage:WaitForChild("CooldownEvent")
local CooldownModule = require(ReplicatedStorage:WaitForChild("CooldownModule"))
local playerCooldowns = {}
local function isOnCooldown(player, skillName)
local cooldownData = playerCooldowns[player] and playerCooldowns[player][skillName]
if not cooldownData then return false end
local remaining = cooldownData.startTime + cooldownData.duration - workspace:GetServerTimeNow()
return remaining > 0
end
local function startCooldown(player, skillName)
local skillInformation = CooldownModule.SkillMoves[skillName]
if not skillInformation then
warn(`Skill "{skillName}" not found in CooldownModule.SkillMoves`)
return
end
local startTime = workspace:GetServerTimeNow()
playerCooldowns[player] = playerCooldowns[player] or {}
playerCooldowns[player][skillName] = { startTime = startTime, duration = skillInformation.Duration }
CooldownEvent:FireClient(player, CooldownModule.Actions.StartCooldown, skillName, startTime, skillInformation.Duration)
end
CooldownEvent.OnServerEvent:Connect(function(player, action, skillName)
if action == "UseAbility" then
if isOnCooldown(player, skillName) then
CooldownEvent:FireClient(player, "OnCooldown", skillName)
else
startCooldown(player, skillName)
CooldownEvent:FireClient(player, "AbilityUsed", skillName)
end
end
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local CooldownEvent = ReplicatedStorage:WaitForChild("CooldownEvent")
local CooldownModule = require(ReplicatedStorage:WaitForChild("CooldownModule"))
local keyAbilityMap = {
[Enum.KeyCode.Z] = "Fireball",
[Enum.KeyCode.X] = "Heal",
[Enum.KeyCode.C] = "Dash"
}
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
local abilityName = keyAbilityMap[input.KeyCode]
if abilityName then
CooldownEvent:FireServer("UseAbility", abilityName)
end
end)
CooldownEvent.OnClientEvent:Connect(function(action, skillName, startTime, duration)
if action == "AbilityUsed" then
print(`Successfully used {skillName}! Cooldown started.`)
elseif action == "OnCooldown" then
print(`{skillName} is on cooldown. Please wait.`)
elseif action == CooldownModule.Actions.StartCooldown then
print(`Cooldown started for {skillName} (Duration: {duration}s)`)
end
end)
I'm sure it works, as I've tested it, but I am mainly asking about modularity & efficiency
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
try that
What's your issue?
what was the problem i did?
Mainly
coding languages are case sensitive, compare the code i sent to ur own code
Hi
ok
I just wish to know if this is the best solution to do this, or if there's something at fault. Everything works, but I want a Client & Server Sync which is re-usable for multiple cooldowns of abilities/gun shootings etc.
There's no "best practice" out there it seems. People suggest os.time() , others tick(), others GetServerTimeNow()
this module doesnt really have any module-ness in it though. Like you should put more into the module if you actually want it to have a reason to be in a module
I'm not sure how to choose
the only problem i did is that i added local script = script.parent
i said case sensitive
ok
its not findfirstchild it is :FindFirstChild
Hmm, I just made this because I am going to have an ability list with cooldown values I'm going to use. This is just an example, or is that not what u mean?
no like wait
Im currently talking to somebody else so I couldnt give full attention
Im here now tho
No rush.
if u want something simple that u expand on later u can use attributes for cooldowns
Why do you need cooldowns for both server and client?
why not
--Server
player:SetAttribute("Cooldown", 3)
--Client
player:GetAttributeChangedSignal("Cooldown"):Connect(function()
for i = player:GetAttribute("Cooldown"), 0, -1 do
print(`Cooldown: {i}`)
task.wait(1)
end
end)
How would I go about that? And how would that be better than having something like this:
local RailgunShot = AbilityTemplate.new({
Name = "Railgun Shot",
Description = "Fires a powerful railgun shot.",
BaseCooldown = 5, -- 5-second cooldown
Animation = "RailgunShotAnim"
})
1- u dont do unneccessary communication between server and client
2- If an exploiter bypasses the local script cooldowns the server wont register what the exploiter does because of the serverside cooldown
Like, why would it be better than something like this:
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
local abilityName = keyAbilityMap[input.KeyCode]
if abilityName then
CooldownEvent:FireServer("UseAbility", abilityName)
end
end)
CooldownEvent.OnClientEvent:Connect(function(action, skillName, startTime, duration)
if action == "AbilityUsed" then
print(`Successfully used {skillName}! Cooldown started.`)
elseif action == "OnCooldown" then
print(`{skillName} is on cooldown. Please wait.`)
elseif action == CooldownModule.Actions.StartCooldown then
print(`Cooldown started for {skillName} (Duration: {duration}s)`)
end
end)
because it has diffrent use cases
and theres multiple ways to make something
ok I sense a problem with this. the abilityName thing surely needs to get verified in the server to ensure the player can use the ability
just a side note
ditch the tutorial and wing it
like you dont want a level 1 player be able to use 99 level abilities
no but still, u don't do unnessecary remote event or function communication
I mean I believe in re-usable code that you just know is well done/thought out.
just put cooldowns both in server and local side imo
The abilities won't have a level difference
But you mean like, people shouldnt be able to use abilities they don't have "equipped" right?
unless a player is able to use every ability in any moment
it should be sanity checked
Which is pretty much the same thing as syncing then, no?
I guess. I always call it sanity check
server should verify it I mean
like if the player has it equipped and stuff
can someone help me to make stand script
Yeah, right. I have something like that implemented, this is just a test script on a different roblox studio thing for now
Hmm
can we not put the whole cooldown system for skills in the cooldown module
when the fireserver is sent to the server
it will connect to the module
and the module will have the function to put it on a cooldown
anyone here good at scripting
Well, this is kinda my question I know we CAN do anything. My issue comes with I'm trying to learn from someone experienced that can tell me about what's the best way of doing things.
I can still name a few things wrong with my code, but I don't know if it's something worth worrying about
Like, things like rate limiting
If someone has some kind of exploit script and just spams the ability button, what will happen?
or am I worrying over nothing now
anyone here good at scripting
i need help anyone
Just ask your question
if you have cooldowns both in local and serverscript then a normal player wont be able to spam skills
an exploiter however will be able to remove the cooldown in the local script BUT because we have cooldown in the server here is what will happen:
Yes, but here comes my part. Everything client wise can be modified,including the cooldown on the client
This is why u want to sync it
and not have a two-way check
Ik just wait
its not a two way check look listen
When you throw a skill
a cooldown on local will start
also
when the server gets the request to throw the skill and eventually passes it as sent
a cooldown will start on the server too
now an exploiter will remove the local cooldown
For a stand script?
and in his screen he will be able to throw limitless amounts of skills
but when you look at things serverside
booths stand to claim and edit
none of them will be registered during the cooldown
so other players wont be affected
Oh I definitely can't make that off the top of my head.
ok then like there is no problem
Like what is different from my code now, that you are trying to explain to me
like just sync it and everything is fine I dont see the issue
oh sorry
its 3 am so
Im kinda stupid
I mean I dont rlly see any delay in the scripts u sent
wdym delay?
like the whole cooldown
Hmm, I think I am digging too deep
yeah like it cant be that complex
just put task.wait(cooldown) and ur good to go no?
I'm making a shark using PathfindingService & Humanoid:MoveTo() but it's moving way too slow in water, any ideas? Changing walkspeed doesn't help, I tried changing CustomPhysicalProperties but that didn't change anything either
Like, I am genuinely asking about what's the most efficient way to handle my situation and more foolproof
But I doubt people here have this knowledge
I mean how more foolproof can it be than syncing
also
if it can be more foolproof
does it need to be?
I don't like inefficient faulty code
are u sure enough that the game will do that well that the best exploiters will mess up your game? like a normal exploiter wont get past sync
But if I don't have the resources I can't really do anything tbh
oh I see
There's not a single tutorial on how to do things properly on the internet
Maybe somewhere it's hidden in an tutorial
But yeah, I will change my mindset. If that time comes, I could refactor the code.
yeah probably
๐คซ
First one to talk is gay
ApplyDescription() doesn't get the attachment positions correctly until i run the game, how can i fix this? i need the positions to be correct on the editor, as im making a plugin
Does anyone know how to create a character selection in Roblos Studio?
repeat task.wait() until game:GetService("ContentProvider").RequestQueueSize == 0
local plr = game.Players.LocalPlayer
local char = plr.Character
local ts = game:GetService("TweenService")
local info1 = TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false)
local newColor = Color3.fromRGB(0, 34, 255)
local hum = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")
local checkpoint = char:WaitForChild("checkpoint")
local BestYPos = 0
local previousText = ""
local previousCheckpoint = 0
local function ShowHint(text:string, waitTime:number)
--print("Showing hint..")
if plr and plr.PlayerGui then
--print("Player and player gui exist.")
if previousText ~= text then
for i,v in pairs(plr.PlayerGui:GetChildren()) do
if v.Name == "HintUI" then
v:Destroy()
end
end
print("previous text is good")
previousText = text
local ui = game.ReplicatedStorage.HintUI:Clone()
ui.WaitTime.Value = waitTime
ui.Hint.Text = text
ui.Parent = plr.PlayerGui
end
end
end
checkpoint.Changed:Connect(function(a)
script["click confirm SFX"]:Play()
if checkpoint.Value == 1 then
ShowHint("Welcome to Capybara's Nextblocks!", 0.05)
task.wait(4)
ShowHint("This tutorial will teach you the basics of our movement system.", 0.05)
task.wait(7)
ShowHint("Proceed through the red door to continue.", 0.05)
elseif checkpoint.Value == 2 then
ShowHint("Move around without stopping to gain acceleration.", 0.05)
task.wait(7)
ShowHint("If you stop moving, you will loose all of your speed. By the way, the blue bar at the top shows how much speed you have.", 0.05)
end
end)
while task.wait() do
local highlightedCheckPoint = game.Workspace:FindFirstChild("checkpoint"..tostring(checkpoint.Value + 1))
if highlightedCheckPoint then
highlightedCheckPoint.Highlight.Enabled = true
end
if game.Workspace:FindFirstChild("checkpoint"..checkpoint.Value) then
local currentCheckPoint = game.Workspace:FindFirstChild("checkpoint"..checkpoint.Value)
currentCheckPoint.Highlight.Enabled = false
local changeColorTween = ts:Create(currentCheckPoint, info1, {Color = Color3.fromRGB(0, 255, 0)})
changeColorTween:Play()
end
end
help why is the checkpoint turning black instead of green lmao
What is the error being shown in the output?
can anyone help plz its a feedback to discord webhook
does all the code of a plugin have to be inside the main script? i have scripts inside it's ui, but when i publish it it just doesnt work
that just means you're sending too many requests in a short amount of time
or it could just mean roblox servers are being ratelimited if shared ips are used
wait a bit and see
Guess what
can anyone help me with anims they play for me but not for other people
are your animations playing on a localscript?
i think
yeah thats why
ty
@raven marsh if the animations are in a script in like ServerScriptService then it will run throughout the entire server and everyone can see it but if it runs in a local script then only you as the player would be able to see it on your screen since the player is considered as a client and for local scripts it would only take the client side (or your player/ your screen)
Normal Scripts run on the server and Local Scripts run on the Clients
Unless ofc there is any communication between the two so like one way communication or two way
One way communication is when the server sends a message to all clients or a client or it can be the other way around and two way is when the client sends a message to the server and the server responds back to the client I believe is how it works
Also two way communication might be better to use then just one way but it can go either way
Iโm still kinda learning this process but I believe I understand it quite well
does anyone know how I could script the hammer to go flying when this animation happens and deal damage to players?
include/compiler.h
should i get into frontend
You're sending too many requests and you could do is batch the requests
Sure if you want
can someone message me i have a question about coding
Sure
check dms please
can someone message me rq i have some bug in my code i have no idea how to fix it
mouse.WheelBackward:Connect(function(scrollzoomi)
if fov + 0.2 <= maxFov then
fov = fov + 0.2
script.ProportionalPTZ.CameraCurrentFoV.Value = fov
interface.Zoom.Text = "X:" .. math.ceil((maxFov/fov)-0.5)
end
end)
mouse.WheelForward:Connect(function(scrollzoomo)
if fov - 0.2 >= minFov then
fov = fov - 0.2
script.ProportionalPTZ.CameraCurrentFoV.Value = fov
interface.Zoom.Text = "X:" .. math.ceil((maxFov/fov)-0.5)
end
end)
``` How can i make my camera zoom in both smooth and sorta fast. No matter where i put it, it only does one or the other.
Just delete the weld and add a body velocity with raycasting it's not that hard and make the raycast do dmg
wheel backward?
That's bc you need to make them public
didnโt know that was a function ngl
Configure them, don't ask me how I don't know too lol...
mouse wheel backward
how would I make make a part that always positioned infront of the players root part even when player is moving
thx
Np
I think that you can also use pathfinding but that's a bit more complex
Stick to welds for now
I logged back in after a couple months of not touching this code and im getting an error on datastoreserivce? Was there some change?
you have no variable named "DataStoreService"
๐ญ
any1 knows why cframe.new bugs when a part is supossed to look at the sky center?
weird they changed all my code
nobody changed your code g
it all worked a couple months ago now im getting errors up my A
I think I resolved it now but damn
perhaps a find all replace all
nah the issue was it was waitforchild waiting for the cash folder but there was no cash folder because the datastorge script was broken
yeah because the variable is local datastore but you tried to use it as DataStoreService
yeah idk it was a script I pulled from the developer documents which worked fine at the time
it would never work in that state so idk what you've been doing
Yo michael
idk how then because it did work
?
it literally cannot work ๐ญ
:GetDataStore() would always fail
Dm's rq
js say it here
I dont have proof it did work other then a video of it adding value
I'm in the middle of a flight so I might not be able to talk in a bit
but istg
yo what part of it can never work doesn't make sense
youre trying to use a variable that references nothing
therefore the get datastore method would always fail
since youre indexing nil
somehow you changed datastoreservice to datastore
What's the best way to learn pathfinding
reading this
Thx so much bro like
well anyways I fixed the error so now I gotta learn how to make a door transparent onyl for the user who clicked it
by doing it on the client
yeah I know what that means
Ok then you're in good shape
well actually I do but im not smart enough to code it
listen for clicks on the client, set the transparency on the client
thats a whole lotta words I don't know, im just gonna try a remote event
remote event adds unnecessary latency
learn the difference between the client and server
sucks for the players then
it would be easier to script to just do it all on the client ๐ญ
I dont wanna learn all that
youre not learning anything youre literally just doing it in a local script
Does anyone know why, when I create a ProximityPrompt, it only works the first time I trigger it? The ProximityPrompt appears but doesn't work anymore
youre doing the same thing everytime its triggered
are you saying youre getting your walkspeed back to 16 again, and then triggering it and nothing happens?
I have placed in another script that when pressing a button, the speed returns to normal and the ScreenGui gets disabled, but it only works the first time and not the second
the another scrit is a textbutton and always works
put a print at the top of triggered and see if it prints multiple times
but the proximitypromt only one
but the walkspeed still in 16 and the screengui still in false
is the textbutton a local script
yes
and the prompt is a server script
yes
that would be my only guess as to why
put the triggered connection on the client and only set the walkspeed and ui if its the local player who triggered it
how i can connect the triggered to the client
This is the most disorganized code its hard to read
same way you connect it on the server except you cant parent the local script to the prompt
ok
thx
Yo i made a secret for my game to use my api key, the secret works in game but in studio it errors could not find secret with given key why does this happen?
idk it look ok
Yes
supposed to be like that?
I donโt know
wdym
can anyone can help me scripting :<
No
Trying to figure out remote events, is there something i'm doing wrong
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:FindFirstChildOfClass("RemoteEvent")
local function onTouched()
remoteEvent:FireServer(Color3.fromRGB(255, 0, 0), Vector3.new(0, 25, -20))
print("worked")
end
remoteEvent.OnClientEvent:Connect(onTouched)```
you cant fire to the server and also listen for a client event
remote events require two scripts, the server and the client
Oh yeah im dumb, I should've scrolled down a bit more
What is JavaScript and why is JavaScript #challengeaccepted #trendingreels #trending #viralreels #debatepresidencial #motivationalquotes #IT #computerscience #computerengineering
1555
Anyone got some small 500 rbx commission?
why
Why do you think....
comments make it feel like a llm
which it probably issssssss
That was when I was still learning tween service and sending it to my friends who don't know coding that kuch
I've learned now that I don't like comments and don't use them anymore
what does the child and parent in scripting act as?
I am a bit confused between those two
Child is the inside of an instance
Parent is what the instance is inside of
Shouldnโt be hard to understand, youโve probably used the explorer in your pc
hmm...it's just that I am learning to script so I am a bit confused
Ah yes
So like
child acts as a file inside the folder
If you put an imagine inside a folder
that means, the folder is the parent?
Folder = parent, and imagine = child
I got it clear now, thanks a lot
hmm and also in this line of code, there are two brackets present. So that means the brackets act as an separater right?
like
one is in the last end
Wdym what brackets
hold on
@somber vault
that means that two functions are present in the killbrick right?
like 2 in one?
Yes kind of let me explain
Aight, I am here
Kill brick is the kill brick and its a part
All parts got an event listener called Touched
With events you can multiple stuff but in this case you have used the :connect method/function
So every time the event fires (part gets touched) the function in the โ()โ will run
Aight so that means when it's touched the code inside the second bracket will run?
You can also place the function above by just copying it and giving it a name
Yes
Hmm giving it a name like using comments to name it or an actual name?
An actual name, function funcName() end
Then you put the function name in the connect
I am a bit confused but let me try to make out, so the function funcName serves as a function naming? Like giving it a name
is runservice heartbeat heavy on the performance?
Yes
Its the name of the function
Thats all
Aight then, got it. Thanks
it depends on what is running in it
lets say I want to spawn coins in a certain area. I want these coins to reset every designated duration. What is the best way to do it? I already made the designated area spawns and what not but cant decide on how I should loop it
hey there! what triggers the script injection permission on plugins? i just published one and when downloading it says my plugin injects scripts, even though it doesnt
task.wait/delay
why is my beams like kind of disconnecting from their attachments whenever i transfer them from the rps to the character? they would only reappear when i manually set the beams attachements again
yeah but I need it to loop throughout the game. The coins should always be in circulation
hb?
hearbeat
yh
Im thinking like if I should do it so that
it only spawns when a player is nearby
its fine to do that
but like a player could exploit it by entering and leaving the range
wdym
lets say the coins wont generate unless a player is in 100 stud distance
yeah
would doing this improve performance first of all
yeah
anyways so a player could like get in the range collect coins and leave the range before coin delay ends
then enter range again to spawn them again
debounce
yeah so wouldnt debounce cause calculation in the background constantly
reducing performance further or nah
compared to the cost needed to modify a coin/render them no
if it constantly spawns right
and you can also just use task.wait to check every x interval instead
this coin placement is happening on the serverscript
yeah you can still use task.wait
so what if a player gets out of the range and then gets in and repeats this constantly spawning and despawning coins for everyone
no no I added it as a side note for my second problem
ok so I should make it distance based spawning
go for it
I should still use heartbeat?
or like while player in range do
or smtn like that
code we made together didnt work yesterday but I got it to work rn
u have a lot to do
so when I spawn and object and move it it first spawns at 0,0,0 for a moment
it is normal right
games just hide that area i suppose
no like watch the video
the object spawns in at 0,0,0 then it is placed
is this a mistake made by me or this is how it is supposed to work
im going over the docs rn
listen attentively
When you create a new object in Roblox Luau using Instance.new(), its initial position is (0,0,0) relative to its parent. If you set the parent (e.g., to the workspace) before setting the position, the object will first appear at (0,0,0) in the game world.
yeah
and yes this behavior is normal
if you're setting its the parent before the position
so the other games just make it so that the player doesnt see the 0,0,0 area
idk what the other games do lol
yeah because I first create a transparent zone
that zone checks for a position
if it is empty it proceeds with the part creation
In this case, the part's position is set to (5,5,5) in its own coordinate system before being added to the workspace
then the zone destroys itself
ok
local zones = Instance.new("Part")
for props, value in pairs(zoneProps) do
zones[props] = value
end
local params = OverlapParams.new()
params.FilterDescendantsInstances = {part, game.Workspace.Baseplate, spawnArea}
local emptyZone = workspace:GetPartsInPart(zones, params)
if #emptyZone > 0 then
zones:Destroy()
return false
end
task.wait(1)
zones:Destroy()
```I made the task.wait 1 so it is easy to visualize it
so what is the issue here?
there is no issue yet I just wanted to learn about the whole spawning in 0,0,0 thing
Congratulations, you've learnt it.
also should I just remove the task wait or keep it as 0,01
does anyone here know how i put the old 2006 animations on a startercharacter rig im so lost
wasnt talking to you
๐
What should i do if i dont want players to be able to use some of the functions in a module? For example what if i dont want hackers to save data using the module.Save() function?
Like what is the most efficient way to do this, remote functions?
hackers cant do anything on the server side, so your data saving should be fine, they can only modify their own client
also no hackers can spoof remote functions and send false signals to the server
any idea for a scripting project for portofolio?
Okay thanks. And do you know where should i put the module?
ServerStorage, ReplicatedStorage etc.
They cant touch any modules that is not used by client
Store them in server storage / script service and you are good to go
They can see the modules in Replicated Storage
if its server side then serverscriptservice or serverstorage
@somber vault but what if i wanna read data from client-side? Would there be a problem if i put the module in replicatedstorage?
Hello everyone, question pls. Sometime my code doesnt work when the game loaded and sometime it does if i add a task.wait(...) before everything. I think it has something to do with the order of how scripts are loaded but dont know how to fix this. Any suggestion?
did someone ghost ping me
i did sorry
alg
@twilit parcel Does the script just start or does it function through an event?
use wait for child
i thought you saw the message it was just "@ nulatic alr thanks"
it just starts
Without any wait before or anything else?
oh lol
this for example
local camera = game.Workspace.CurrentCamera
camera.CameraType = "Scriptable"
Is it a serverscript or a local script?
it is a local script
Ah I think I know the problem
It often happens that many thingss didn't load in local scripts
You need to use
game.Workspace:WaitForChild()
i ran to this problem while making my game during the game jam too but didnt konw how to fix it so i just ended up forcing the script to turn on and off for it to work lol
how to optimise your game better
Do you mean recuding lag?
make the performance better
@twilit parcel Does it work now?
you cant use wait for child using current camera tho right?
like for current camera i mean
its an instance so you can
WaitForChild should be always used in a local script when the game didn't load 100% yet.
If you require the modulescript from client side or put it in replicatedstorage, Exploiters can access it since client can reach it now
If they change the values in the module, it will only replicate to the client itself
so it will replicate to the exploiter only, not other players as long as Im aware
wait a second rq
yeah right, and should i make two separate folders, one in ss and one is rs?
Depends on what you are using the module for
If you are storing value data such as coins, player stats etc, that should be in server
so like the datastore modules goes to ss and the tempdata goes to rs
but i couldnt read the data from the client, could i?
You can with remote events
@twilit parcel I tried it myself and it worked perfectly fine
You would need to secure your remotes tho
Gtg now bye guys!
hackers when event:FireServer(playerCoinCount):
okay but why shouldnt i just put the module inside rs then?
huh thats weird
oh alr, cya!
cya!
bye!
if they try to change the data, only they would be effected and not the server
if they want to read the data, they can since the module is replicated to the client
did bro just answer his own question ๐ญ
@twilit parcel I dont know much about the instance "Camera" but if CurrentCamera doesnt work try WaitForChild("Camera") it worked for me too
Bye!
am i right? ๐ญ
Yes
However if you store, lets say coins in replicatedstorage in a module
they can just make their coins 99999 and get every item by manipulating
i mean ye but current camera isnt an instance inside the workspace tho
yeah, client can use scripts and read stuff off replicatedstorage but cant change anything
but i check the coin value from the server
even if they do set their coin count to 999999, it will only be for their client.
on everyone else's laptop their count will still be 0
Still wont prevent them from getting the most expensive item in the game by manipulating the data
hmm idk about that since they're only modifying information on their client
oh i thought it was server side lol
No, modulescript in replicatedstorage
what is the easiest way to make a parry system
Set the block value to the tick when they press the block button
prolly
You would need a check for EVERY DATA you got
that is not practical
attributes to detect if the person is parrying
You wouldnt want to check if player got more than 999999 coins for every data value
if so during an attack then idk like play parry effect
ok thx
remote function
when the player is buying something, i just do the "if Coins >= ItemCost then" from the server
mb
anyway I would recommend:
Important data such as Ingame currency, player stats etc. goes to server modulescript
Visual data goes to rs modulescript
hey guys im working on a game who wants to be a mod for free (you can moderate when you want)
make a folder under the player and add number/string values there
they auto replicate, when the player leaves you read them and overwrite the data
no no
i meant for this
Generally speaking when dealing with stores, it would be better if they're using serverscriptservice while the things that will be bought by the player are in replicated
I need help
If you want an easier life just go for a simple server script
What is it
How to make make script to claim booths
Im not sure but im pretty sure you will have to apply some sort of something inside the booth model that only allows the said player that claimed the booth
like a value or a key
then if someone else try to claim the booth it will check if its already claimed then it can be nulled
I think retention only tracks new players while stickiness tracks all the players that played your game
Like how long they played your game
I did that but the claim thing doesn't work
aha interesting
What kind of game did you made btw?
its tycoon game
Those are the stats we have with testers , we didnt release the game yet
Just check a free model booth if possible then study how it works, that's usually what i do when encountering stuff i don't know.
no its fine, but the way i told you is easier
why doesnt this work
local baseplate = game.Workspace.Baseplate baseplate.Transparency = 0.3 baseplate.Material = "Limestone" baseplate.BrickColor = "Navy blue" baseplate.Size = 0.1
output ?
brick color is the only one that is not working
because thats not how data types work
BrickColor.new()
BrickColor.new("Navy blue")
get sigma
Very sigma after this
I can't really hear what you're saying
he said what the sigma
I dislike brick color
Brick color is amazing ๐ ๐ค ๐ฝ
hey guys, what would happen if i set a transparent gui to be the teleport gui?
would it fully show the game loading?
and what about the part where the 3d things arent loading but the backend stuff is?
i think it just makes it opaque
wait lemme make a game real quick
either that or it slaps a grey background on it
gray background
guys
what
it just makes it opaque
are u a roblox scripter
it adds a black background
or i just dont understand what opaque means
i am hiring
no he isnt
yes?
its the opposite of transparent
can u do combat systems
no he cant
^^
can you?
LOL
Yo
what
no
combat system?
i just blocked him lol
nuclear option
yea lol
dm
hey idk who to post on scripter hiring so if someone can mp me ? pls
hiring or hireable?
u just /post
guys, why is it when I turn the camera away from an axis, it wont tilt forward correctly?
ok thx
is there any roblox scripter who can make a combat system
can u dm
It might be because of toOrientation, does it account for transformation when used like this???
Maybe try using lookvectors like this
local rightVector = camera.CFrame.RightVector -- Right direction of the camera
local forwardVector = camera.CFrame.LookVector -- Forward direction of the camera
local tiltDirection = forwardVector * -seat.Throttle + rightVector * seat.Steer
xAngle = math.clamp(tiltDirection.Y * AngleIncrement * dt, -maxAngle, maxAngle)
zAngle = math.clamp(tiltDirection.X * AngleIncrement * dt, -maxAngle, maxAngle)
how do i change the color of the Cayman theme for Jekyll on GitHub Pages?
Heres the code i use:
-
-
@import "{{ site.theme }}";
body {
background-color: #1D1D1D;
}
.page-header {
backgorund-color: #171717;
background-image: none;
}
what did i do wrong?
local mypart = game.Workspace.Part
script.Parent.Touched:Connect(function(Hit)
if Hit.Parent then
mypart.transparency = 0
end
end)
Hit
what should i change?
Why does it still print template can be destroyed if I am trying to make it so it doesn't get the template? I know this is probably really simple but my head cant wrap around it
hit.Parent:FindFirstChild()
if im correct
The numbers
i actually thought of that! sorry its my first day scripting:)
You can just search it up and identify what color
what about it
?!?! thats not the problem
What is
okay ill explain
i need to change the colors of my site to a dark theme
but its not working
Idk what your template is but if it's an imagelabel the logical expression always evaluates to true because of the use of or
local mypart = game.Workspace.Part
script.Parent.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(mypart) then
mypart.transparency = 0
end
end)
backgorund
no doesn't rly work still got the same problem
why doesnt this work?
already fixed it a while ago, didnt work for me
Ah sorry idk then
