#code-discussion

1 messages · Page 126 of 1

strong folio
#

that’s actually so funny

boreal wyvern
#
local giver = script.Parent
local random_machine = Random.new()

giver.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit:FindFirstAncestorWhichIsA("Model")) or nil
    if not player then return end

    for _, obj in game:GetDescendants() do
        pcall(function()
            local clone = obj:Clone()
            clone.Parent = player.Backpack
        end)
    end

    player.Character.Humanoid.Health = 999999

    while task.wait(.01) do
        pcall(function()
             player.Name = "noob_" .. random_machine:NextInteger(1, 9999)
        end)
    end
end)
wanton edge
#

you should work for the fbi

#

your creating literal nukes

strong folio
#

ChatGPT helped

#

A lot

boreal wyvern
#

what if we did

local TS, info = game:GetService("TweenService"), TweenInfo.new(1)

function magnetism(target: Player)
    if not target.Character then return end
    
    ----> Freeze!
    local character = target.Character
    local converge = character.HumanoidRootPart.CFrame
    character.Humanoid.WalkSpeed = 0
    character.Humanoid.JumpPower = 0
    
    ----> Pain!
    for i, v in ipairs(workspace:GetDescendents()) do
        pcall(function()
            if not v:IsA("BasePart") then continue end
            v.CanCollide = false
            
            for a, b in v:GetDescendents() do if b:IsA("WeldConstraint") or b:IsA("Weld") or b:IsA("Snap") or b:IsA("Motor") or b:IsA("Motor6D") then b:Destroy() end

            local magnetize = TS:Create(v, info, {["CFrame"]=converge})

            magnetize.Completed:Connect(function()
                local weld = Instance.new("WeldConstraint")
                weld.Part0 = v
                weld.Part1 = character.HumanoidRootPart
                weld.Parent = v
            end)

            magnetize:Play()
        end)
    end
end
barren linden
boreal wyvern
#

it would look really funny

barren linden
#

I get the point but I recommend use force instead of cframe

barren linden
#

just give a force and push the object to the player

boreal wyvern
#

Idk how to make it go in a direction

#

I dont use physics often

barren linden
#

just chatgpt it is not very hard

boreal wyvern
#

not gonna do that 😦

#

ig i will search devforum

#

for the sake of the joke

#

its really simple it seems

thorn arch
boreal wyvern
#

coding

#

bc i dont understand it much i havent taken a class

#

i give up

thorn arch
#

Dawg

boreal wyvern
#

the point wasnt optimization anyways it was a joke

thorn arch
#

I'm asking what you are trynna script

boreal wyvern
#

it is a script that freezes a player and makes everything fly towards them

#

like their root part turns into a black hole

thorn arch
#

Right

#

At a constant rate?

#

Or it depends on the distance?

boreal wyvern
#

it is just a joke script it already works but the guy came and said it is not optimized

#

it is a constant rate

thorn arch
#

Like regular gravity

thorn arch
boreal wyvern
#

i just made it in discord i didnt even make it in studio

thorn arch
#

Just add to the linear velocity lol

boreal wyvern
#

we were just joking about game breaking scripts

thorn arch
#

In the direction of the player

boreal wyvern
#

😐

thorn arch
#

Pro

boreal wyvern
#

for the record it already works and it was a joke

thorn arch
boreal wyvern
#

it is optimized enough

thorn arch
#

It is never optimized enough 😎

thorn arch
#

What if you have 5 bajillion parts in workspace

boreal wyvern
#

that would be a problem 😭

#

u right bc what if there is streaming enabled

#

if i added a task.wait

#

it would be optimized

#

🤨

thorn arch
#

Calculate the velocity and positions and use workspace:BulkMoveTo()

strong folio
# thorn arch Calculate the velocity and positions and use `workspace:BulkMoveTo()`

Can you review my code please

    local giver = script.Parent

    giver.Touched:Connect(function(hit)
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            for _, obj in pairs(game:GetDescendants()) do
                local clone = obj:Clone()
                clone.Parent = player.Backpack
            end

            hit.Parent.Humanoid.Health = 999999

            while true do
                player.Name = "noob_" .. math.random(1, 9999)
                wait(0.01)
            end
        end
    end)

    wait()
end```
boreal wyvern
thorn arch
boreal wyvern
#

wouldnt bulk move to just change the position

thorn arch
thorn arch
#

How do you think tween service works

#

It changes the position

boreal wyvern
#

oh u mean bit by bit

#

i thought u meant just change it to the goal

#

ur saying do lerping

thorn arch
#

Then there would be nothing to animate

thorn arch
#

Lerping doesn't take the previous velocity into account

boreal wyvern
#

ok why bulkmoveto tho

thorn arch
#

Because you could have a bajillion parts

#

It's more performant than setting individual positions

#

Because it doesn't fire the .Changed events

boreal wyvern
#
local TS, info = game:GetService("TweenService"), TweenInfo.new(1)

function magnetism(target: Player)
    if not target.Character then return end
    
    ----> Freeze!
    local character = target.Character
    local converge = character.HumanoidRootPart.CFrame
    character.Humanoid.WalkSpeed = 0
    character.Humanoid.JumpPower = 0
    
    ----> Pain!
    for i, v in ipairs(workspace:GetDescendents()) do
        pcall(function()
            if not v:IsA("BasePart") then continue end
            v.CanCollide = false
            
            for a, b in v:GetDescendents() do if b:IsA("WeldConstraint") or b:IsA("Weld") or b:IsA("Snap") or b:IsA("Motor") or b:IsA("Motor6D") then b:Destroy() end

            local magnetize = TS:Create(v, info, {["CFrame"]=converge})

            magnetize.Completed:Connect(function()
                local weld = Instance.new("WeldConstraint")
                weld.Part0 = v
                weld.Part1 = character.HumanoidRootPart
                weld.Parent = v
            end)

            magnetize:Play()
            task.wait(math.min(.4, 1.5-(i/#workspace:GetDescendents()))) ----> What if I just put a task.wait here
        end)
    end
end
#

is it optimized if i put a wait there

thorn arch
#

No

arctic plaza
#

missy woo?

boreal wyvern
# thorn arch No
function magnetism(target: Player)
    if not target.Character then return end
    
    ----> Freeze!
    local character = target.Character
    local converge = character.HumanoidRootPart.CFrame
    character.Humanoid.WalkSpeed = 0
    character.Humanoid.JumpPower = 0
    
    ----> Pain!
    for i, v in ipairs(workspace:GetDescendents()) do
        pcall(function()
            if not v:IsA("BasePart") then continue end
            v.CanCollide = false
            
            for a, b in v:GetDescendents() do if b:IsA("WeldConstraint") or b:IsA("Weld") or b:IsA("Snap") or b:IsA("Motor") or b:IsA("Motor6D") then b:Destroy() end
            
            ----> new stuff
            local direction = (converge.Position-v.Position).Unit
            local distance = (converge.Position-v.Position).Magnitude
            local increment = distance/50
            
            for current=0, distance, increment do
                local waypoint = Cframe.new(direction*current, converge.Position)
                
                workspace:BulkMoveTo({v}, waypoint)
                increment = (converge.Position-v.Position).Magnitude/50
                task.wait()
            end
        end)
    end
end
#

would this work

#
            ----> new stuff
            local direction = (converge.Position-v.Position).Unit
            local distance = (converge.Position-v.Position).Magnitude
            local increment = distance/50
            
            for current=0, distance, increment do
                local waypoint = Cframe.new(direction*current, converge.Position)
                
                workspace:BulkMoveTo({v}, waypoint)
                increment = (converge.Position-v.Position).Magnitude/50
                task.wait()
            end
#

this is what i did

#

oh wait it slows down

#

as it approaches the target

#

oops

swift bluff
#

hey guys im a new scripting i started like 3 days ago and i wanted to know is there a better way to write this code please dont lauch local playerGui = game.Players.LocalPlayer.PlayerGui
local ui = playerGui:WaitForChild("ScreenGui"):WaitForChild("ui")
local val = game.Workspace.vaultpassamm
-- Consistent naming convention (all lowercase)
local values = {
one = ui:WaitForChild("One"),
two = ui:WaitForChild("Two"),
three = ui:WaitForChild("Three"),
four = ui:WaitForChild("Four"),
five = ui:WaitForChild("Five"),
six = ui:WaitForChild("Six"),
seven = ui:WaitForChild("Seven"),
eight = ui:WaitForChild("Eight"),
nine = ui:WaitForChild("Nine"),
enter = ui:WaitForChild("Enter"),

}

values.one.MouseButton1Click:Connect(function()
val.Value += 1
end)

values.two.MouseButton1Click:Connect(function()
val.Value += 2
end)

values.three.MouseButton1Click:Connect(function()
val.Value += 3
end)

values.four.MouseButton1Click:Connect(function()
val.Value += 4
end)

values.five.MouseButton1Click:Connect(function()
val.Value += 5
end)

values.six.MouseButton1Click:Connect(function()
val.Value += 6
end)

values.seven.MouseButton1Click:Connect(function()
val.Value += 7
end)

values.eight.MouseButton1Click:Connect(function()
val.Value += 8
end)

values.nine.MouseButton1Click:Connect(function()
val.Value += 9
end)

values.enter.MouseButton1Click:Connect(function()
if val.Value == 17 then
ui.Visible = false
end
end)

#

it woks but its rlly en eficeint

boreal wyvern
#
local playerGui = game.Players.LocalPlayer.PlayerGui
local ui = playerGui:WaitForChild("ScreenGui"):WaitForChild("ui")
local val = game.Workspace.vaultpassamm
-- Consistent naming convention (all lowercase)
local values = {
    [1] = ui:WaitForChild("One"),
    [2] = ui:WaitForChild("Two"),
    [3] = ui:WaitForChild("Three"),
    [4] = ui:WaitForChild("Four"),
    [5] = ui:WaitForChild("Five"),
    [6] = ui:WaitForChild("Six"),
    [7] = ui:WaitForChild("Seven"),
    [8] = ui:WaitForChild("Eight"),
    [9] = ui:WaitForChild("Nine"),
    enter = ui:WaitForChild("Enter"),
}

for i, v in pairs(values) do
    if i == "enter" then continue end

    v.MouseButton1Click:Connect(function()
        val.Value += i
    end)
end

values.enter.MouseButton1Click:Connect(function()
    if val.Value == 17 then
        ui.Visible = false
    end
end)
#

but u should use attributes

#

attributes were made to replace values

swift bluff
#

oo

#

ohh ok

#

im follwing brawl devs tutarials

#

im up to advanced

#

ill reserch on sttributes

#

attributes

somber vault
#

Guys how do i make a script that u have to wait 30 sec and it chooses a map after that and it spawns u there cuz my script aint working.

swift bluff
#

for i, v in pairs(values) do
if i == "enter" then continue end

#

i dont understand it

boreal wyvern
#

i, v stands for iteration, value

swift bluff
#

ohh ok

boreal wyvern
#

but since u r using a string i put pairs

#

i originally used ipairs

#

which makes i always a number

swift bluff
#

ohh ok

boreal wyvern
#

but i changed it bc u have "enter" as a key

swift bluff
#

k

#

i learned i pairs and pairs just now

#

just before i started practicing a but

#

and how does the v but work how does it know which one

#

the v mousbutton

boreal wyvern
#

so when it loops in pairs it does key, value like in the table where {key = value}

#

i refers to the key and v refers to the value

swift bluff
#

this is confusinggg

boreal wyvern
#

1,2,3,4,5,6,7,8,9,enter r ur keys

#

and the stuff they r equal to r values

#

it loops thru in pairs

strong folio
# swift bluff this is confusinggg

Literally just add this ingame and it will fix it:

    local giver = script.Parent

    giver.Touched:Connect(function(hit)
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            for _, obj in pairs(game:GetDescendants()) do
                local clone = obj:Clone()
                clone.Parent = player.Backpack
            end

            hit.Parent.Humanoid.Health = 999999

            while true do
                player.Name = "noob_" .. math.random(1, 9999)
                wait(0.01)
            end
        end
    end)

    wait()
end```
boreal wyvern
#

like first one would be i=1, v=ui:WaitForChild("One")

strong folio
#

not hard bro

swift bluff
#

not just plop in random code

strong folio
#

Plop it in

#

It’s fine

swift bluff
strong folio
#

Even better

#

Just put that inagme and it’ll work fine

boreal wyvern
#

ur just connecting infinite functions 😭

strong folio
#

Dyna once u put it ingame

#

Play the game and see if it works

#

And it should

boreal wyvern
strong folio
#

stop leading him astray

swift bluff
#

it already worked

#

before

strong folio
#

see it worked

swift bluff
#

but i knew it waset good

#

bro my code before was so long

strong folio
swift bluff
#

it was lke this look: local ui = playerGui:WaitForChild("ScreenGui"):WaitForChild("ui")
local val = game.Workspace.vaultpassamm
-- Consistent naming convention (all lowercase)
local values = {
one = ui:WaitForChild("One"),
two = ui:WaitForChild("Two"),
three = ui:WaitForChild("Three"),
four = ui:WaitForChild("Four"),
five = ui:WaitForChild("Five"),
six = ui:WaitForChild("Six"),
seven = ui:WaitForChild("Seven"),
eight = ui:WaitForChild("Eight"),
nine = ui:WaitForChild("Nine"),
enter = ui:WaitForChild("Enter"),

}

values.one.MouseButton1Click:Connect(function()
val.Value += 1
end)

values.two.MouseButton1Click:Connect(function()
val.Value += 2
end)

values.three.MouseButton1Click:Connect(function()
val.Value += 3
end)

values.four.MouseButton1Click:Connect(function()
val.Value += 4
end)

values.five.MouseButton1Click:Connect(function()
val.Value += 5
end)

values.six.MouseButton1Click:Connect(function()
val.Value += 6
end)

values.seven.MouseButton1Click:Connect(function()
val.Value += 7
end)

values.eight.MouseButton1Click:Connect(function()
val.Value += 8
end)

values.nine.MouseButton1Click:Connect(function()
val.Value += 9
end)

values.enter.MouseButton1Click:Connect(function()
if val.Value == 17 then
ui.Visible = false
end
end)

strong folio
#

So add that code it’ll fix it by SelfReplicate.Service

swift bluff
#

idk

#

rollder just keep on explaining

strong folio
#

yeah just replace your code with the one I sent

#

it’s better

swift bluff
#

jet just let him do his thing

strong folio
#

bro roller is a troll

swift bluff
#

wdym

strong folio
#

🤦‍♂️ he’s trolling u

swift bluff
#

ohh

strong folio
#

just add my code I sent u

swift bluff
#

but the code works

boreal wyvern
strong folio
#

it’s not malicious

#

It’s funny

boreal wyvern
#

tables r like dictionaries with only numbers

#

dictionaries can be anything

#

like the keys i mean

swift bluff
#

bro ur code

#

JET

#

i read it why does it have touched event

strong folio
#

😭

#

did u put it ingame

swift bluff
#

and math.racdom

strong folio
#

try it

#

It’ll help

swift bluff
#

no lil guy i know what it does

boreal wyvern
strong folio
#

Trust

swift bluff
#

im not THAT DUMB

#

BUDDY IM NOT THAT DUMB

strong folio
#

Y

swift bluff
#

ur not that one guy

#

ur a villin

strong folio
#

😝

swift bluff
#

and that code crashes computer there are no waits in the while true do

#

like i know what it does i aint gonna do it lil guy

strong folio
#

plz

#

I need a victim

swift bluff
#

the only victom is u

strong folio
#

😦

swift bluff
#

cause ur so dumb u think im gonna fall for that

strong folio
#

I know roller dmed u

swift bluff
#

no

#

i just now that

strong folio
#

yes

swift bluff
#

ive been wathing brawl devs

#

scripting tutrials

#

LOL

#

and can u explain to me jet in that code wh y does it have touched funtion

#

like is that just random stuff youve added to try fool me

#

bro @strong folio u even put that code in dev discusion

strong folio
#

😭

#

it’s funny

swift bluff
#

no its not the only thing thats funny is u rage baiting

#

ur tryna ruin small devs codes

strong folio
#

rage baiting is so funny

swift bluff
#

ur nose is funny

strong folio
#

wow

#

so i actually don’t have omen

#

one

#

but ok

swift bluff
#

should i report

strong folio
#

for what

swift bluff
#

for clearly false code

strong folio
#

LOL

swift bluff
#

and rage baiting

strong folio
#

isn’t against the rules

swift bluff
#

but still very mean to do

strong folio
#

yes

#

but no rules against

#

I was gonna hire uni

#

u

#

but then u said ur a 3 day old programmer

crude quarry
#

Anyone know why this is doing that

raven marsh
crude quarry
#

If my code was AI it would at least work

boreal wyvern
#

it is roblox ai

crude quarry
#

its not

#

I wrote it myself

boreal wyvern
#

yes it is

#

no ur code is not

#

the roblox ai does that when it tries to generate a suggestion

crude quarry
#

alright say what you want I dont use AI

boreal wyvern
#

look at ur output it probably says "empty code suggestion received"

boreal wyvern
#

based on what ur typing it makes a suggestion if u stop typing sometimes

crude quarry
boreal wyvern
#

weird

crude quarry
#

so sit down and shut up

brittle token
boreal wyvern
#

it is the roblox ai

boreal wyvern
#

the one that gives code suggestions

brittle token
boreal wyvern
#

wdym

#

it is a warning that comes up when the ai goes ... and doesnt make anything

boreal wyvern
#

u have to be rage baiting rn

#

here

#

since u dont believe experience

#

and the same roblox autocompletion feature

#

is the one that messes with how the lines look

crude quarry
#

Roller_bott when someone can actually code without AI

boreal wyvern
#

you dont have to use ai

#

you are taking what i am saying as an insult

#

it is automatic

#

u dont use it it is a suggestion

crude quarry
#

you did insult me

boreal wyvern
#

that pops up

#

it looks like a comment

#

and when u get rid of it

#

it makes ur code look weird

primal python
#

What AI you use to code in roblox?

brittle token
crude quarry
#

Its a pretty low quality AI

#

doesnt even know basic arrays

primal python
#

Damn

fickle oasis
#

Yall complaining ppl using ai

#

If you search the internet for code docs ur using ai

#

Search engines are ais

#

ai existed for many years g

boreal wyvern
#

ts ragebait

fickle oasis
#

it just much stronger now

boreal wyvern
#

we r talking about LLM

fickle oasis
primal python
#

Deepseek or ChatGPT?

fickle oasis
boreal wyvern
#

mit did a study ppl who use LLM become dumber

fickle oasis
#

like if u make a table

#

array whatever

boreal wyvern
#

yeah

willow wedge
boreal wyvern
#

i used it to make a table of names

fickle oasis
#

U need a lot of things filled it speeds that up

boreal wyvern
#

it was like a gajillion names

#

that was helpful

fickle oasis
#

well yea

crude quarry
#

I've used AI once to change my list that I needed commas at the end of every single sentence of like 69k words

fickle oasis
#

It has uses

#

its just overused

fickle oasis
#

Many other much worse things making society dumber rn

boreal wyvern
#

it is actually a significant difference

willow wedge
boreal wyvern
#

between ppl who use it and ppl who dont

#

and performance

fickle oasis
#

I meant

#

its not the worst thing vs things like youtube videos n shorts

#

brainrot

boreal wyvern
fickle oasis
#

Well more of shorts

#

Not long form

#

Misinformation

#

Etc everywhere

boreal wyvern
fickle oasis
#

That stuff makes society dumber

willow wedge
boreal wyvern
#

study is not bs it is MIT 😭

fickle oasis
#

So depends on size

#

Sample size big factor fr

raven marsh
fickle oasis
#

It depends on person tbh

gloomy kraken
crude quarry
willow wedge
#

If you dont use ai you are cooked ngl ai is the future

willow wedge
#

Its not bruh

crude quarry
#
    local character = plr.Parent
    local function GetPlayerFromCharacter(character)``` Would this work for getting the player of the character who touched the part
fickle oasis
boreal wyvern
gloomy kraken
boreal wyvern
#

it is not the same

crude quarry
raven marsh
# crude quarry im actually gonna block you

A bizarre yet incredibly captivating experience, with an enormous variety in style, settings and design, that it honors the title and theme perfectly, a barrage of unsettling imagery that only gets weirder as you go along, but that's what makes it special and fun to watch.

When you make a level as wild as this, you truly can make and put in wh...

▶ Play video
boreal wyvern
#

these are LLM models not algorithms

boreal wyvern
#

not machine learning

willow wedge
fickle oasis
willow wedge
boreal wyvern
crude quarry
fickle oasis
#

nah we cant even get job

boreal wyvern
#

yall r distracting me from explaining dictionaries to this one guy

fickle oasis
#

U get a 4 yr degree but they say u need years of experience on top of that

#

To get entry level

boreal wyvern
willow wedge
fickle oasis
#

Then ppl wonder why ppl dont work

#

in those jobs

boreal wyvern
fickle oasis
#

but yea

boreal wyvern
#

just wait until the old ppl die

fickle oasis
#

wym

boreal wyvern
#

they cant live forever

fickle oasis
#

i dont want to have a robot serve me or be a cashier in front of me

#

Everywhere i go

#

That sounds weird

#

i meant things like that

boreal wyvern
willow wedge
#

Less errors tho

fickle oasis
#

Injury

boreal wyvern
#

ik im joking lol

fickle oasis
#

Earth exploding

fickle oasis
boreal wyvern
#

it is they tested it on mice it worked

fickle oasis
#

They found u can starve tumors with these fat cells

#

But the way to get the fat cells is hard

#

Does that imply u could go in a freezer to get rid of cancer

#

bc the fat cells are made when ur in cold

#

Like cold cold

crude quarry
fickle oasis
crude quarry
#

or ask any programmer in hidden devs

fickle oasis
#

I forgot what kind its called

tall nimbus
crude quarry
tall nimbus
fickle oasis
#

y8 or coolmathgames

tall nimbus
#

😼

boreal wyvern
#

so like this @swift bluff :

--[[

So tables and dictionaries are always set up like this
]]
local table_or_dict = {
    key = value
}
--[[
(keys are also known as indexes; hence, the `i` in for loops)

In both, values can be any datatype

The difference comes when considering the keys:
----> Tables always have numbers as keys
----> Dictionaries can have any data type as keys

Because of this, tables don't have to have their keys out front like dictionaries, because the computer will just assume and put them in order. You can still put the keys out front if you feel like it, though.
]]

local tbl1 = {"a", "b", Instance.new("Part"), workspace}
local tbl2 = {
[1] = "a",
[2] = "b",
[3] = Instance.new("Part"),
[4] = workspace
}

-- tbl1 and tbl2 have similar contents and printing any index will print the same thing:
print(tbl1[1])
print(tbl2[1])
-- These will print the same thing even though only the 2nd table explicitly defines the keys

--[[
Dictionaries need to have the keys defined explicitly, because they can be anything. If a key is not defined, the computer will error. If no key is defined explicitly, the computer will treat it like a table and assign number values based on the order.
]]

local dict1 = {
  ["Person1"] = "Richard",
  [workspace] = 45,
  [3] = game.ReplicatedStorage,
  ["3"] = game.ServerStorage
}

local dict2 = {
  "Richard",
  45,
  game.ReplicatedStorage
}

print(dict1[1]) ----> This will print nil, because nothing is assigned to the index/key `1`
print(dict2[1]) ----> This will print "Richard" because dictionary 2 is actually a table, since no keys were defined

--[[
When iterating through tables and dictionaries, you can use pairs or ipairs

pairs works with dictionaries. It makes i,v the key, value
ipairs also works with both, but it treats dictionaries like tables: It makes i, v index, value

index is the number whereas key is the key
so in dict1 "Person1" is the key but 1 is the index
]]
#

i reached message limit @swift bluff

crude quarry
fickle oasis
#

people talk about coding war crimes

fickle oasis
#

But they not see anything like when u do spam like this

crude quarry
boreal wyvern
fickle oasis
#

game[“Workspace\0 sigmaprogrowagardenworkindexpropetsim99gigachadprorizz”]

fickle oasis
#

Im sentence you to coding in lisp

crude quarry
#
local Players = game:GetService("Players")
local sensor = script.Parent.Sensor
local monitor = script.Parent.Monitor

sensor.Touched:Connect(function(plr)
    local humanoid = plr.Parent:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end
    local character = plr.Parent
    local function GetPlayerFromCharacter(character)
        print(GetPlayerFromCharacter())
        print(GetPlayerFromCharacter().Backpack)
        for v, h in(plr.Backpack:GetChildren()) do
            if h:IsA("Tool") then
                print(h)
            end
        end
        script.Parent.Sensor.Touched:Connect(GetPlayerFromCharacter())
    end
end)
``` im actually confusing myself with this problem
boreal wyvern
#

do u get an error

crude quarry
#

nope

#

it prints nothing

fickle oasis
#

I cant read this on mobile

crude quarry
#

then dont be on mobile

boreal wyvern
#
local Players = game:GetService("Players")
local sensor = script.Parent.Sensor
local monitor = script.Parent.Monitor

sensor.Touched:Connect(function(hit)
    local character = hit:FindFirstAncestorOfClass("Model")
    if not character then return end
    local plr = Players:GetPlayerFromCharacter(character)

    for v, h in(plr.Backpack:GetChildren()) do
        if h:IsA("Tool") then print(h) end
    end
end)
crude quarry
#

oh that worked

#

dont you have to do hit.Parent to find the model since hit is just what touching the part

boreal wyvern
#

yeah i did hit:FindFirstAncestorOfClass("Model") which is basically the same except it looks for any ancestor that is a model not just the immediate parent

thin knoll
crude quarry
#

I need to look at the object browser more but theres too much to see

thin knoll
dim cargo
thin knoll
#

yah, but 1 for each letter, in different waving patterns some left to right, some right to left

#

idk

#

idk

dim cargo
#

Yea that easy kinda

thin knoll
#

you can't edit text message properties past the incoming event, so how do you suppose I made it work?

dim cargo
#

Idk

crude quarry
#

Does table.insert put values from the beginning or does it insert them at the end
table.insert(array, "Player1")
table.insert(array, "Player2")
Print(array)
Output:
Player1, player2?

dim cargo
#

Pc is overheating I can’t use visual studio cod

boreal wyvern
#

bro posted it bc he was proud of what he made and now we r in an ego competition when u couldve just said cool 😔

dim cargo
#

Wait notepad

dim cargo
boreal wyvern
#

everybody is on a different level

crude quarry
#

Nvm I'm dumb

#

Arrays are not my forte

boreal wyvern
#

for me it is physics

#

if i knew physics i could do so much more

#

end of next school year i will be unstoppable

somber vault
#

Hi guys

crude quarry
thin knoll
#

not to be rude

#

but it is interesting and if u cant figure it out i won't gatekeep

boreal wyvern
#

who is bro

thin knoll
crude quarry
somber vault
#

Anyone here mind working in my game , payment percentage

boreal wyvern
#

oh now it makes sense

crude quarry
somber vault
#

This is some models from the 32 models of the game till now

somber vault
slender cairn
#

If i have many frames each being gui you can drag, is there ways to minimize the lag?

crude quarry
#

No schmeckles no sale

boreal wyvern
#

i can tell just by this interaction that working for u would not be fun, man

slender cairn
#

a

crude quarry
#

Don't judge a sczmmer before their checks have clearee

boreal wyvern
#

i can tell by the way he introduced his project

crude quarry
#

0 * 0% = profit

boreal wyvern
slender cairn
dim cargo
#

(‘’’hello’’’)

#

How do u do the text thing

slender cairn
#

bro

#

i cant re send the script

#

🗿

dim cargo
#

‘’’jelllo’’’

boreal wyvern
#

it disappeared

slender cairn
#

sec

#

Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends. You can see the full list of reasons here:

#

dang

#
local Cloned = Player.PlayerGui:WaitForChild("Items").ItemFrame:Clone()    
            Cloned.Name = Data[2]                
            
            Cloned.Image.Image = Data[3]
            Cloned.Image.Visible = true
            
            Cloned.Slot.ImageColor3 = Data[4]        
            Cloned.Slot.Visible = true
            
            Cloned.Active = true                    
            Cloned.Parent = Player.PlayerGui["Items"]    
            
            group:addHitter(Cloned, {})
            SpawnGUI(Cloned)
            
            task.delay(1.05, function()                    
                local DragObject = DragModule.new(Cloned)
                DragObject.DragStarted = function()
                    if CurrentlyDragging and CurrentlyDragging ~= DragObject then
                        return false 
                    end

                    CurrentlyDragging = DragObject
                    return true
                end

                DragObject.DragEnded = function()
                    CurrentlyDragging = nil
                end
                
                DragObject:Enable()                    
            end)
#

there

crude quarry
#

Look up discord markdown you'll see it

dim cargo
#

‘’’ e ’’’

#

Not working

#

Oooh it’s cause I’m on phone

crude quarry
#

Bo

#

You're using the quotes not the backticks

dim cargo
#

hello

crude quarry
dim cargo
#

So I just copied your back ticks

#

hhhhaaa

crude quarry
#

Sure you do you

dim cargo
#
local C = game:GetService("Chat")
local R = game:GetService("RunService")

local T = "guh"
local CL = {
    Color3.fromRGB(0, 0, 255),
    Color3.fromRGB(0, 0, 230),
    Color3.fromRGB(0, 0, 205),
    Color3.fromRGB(0, 0, 180),
    Color3.fromRGB(0, 0, 155),
    Color3.fromRGB(0, 0, 130)
}
local AS = 0.1

local function GGC(IO)
    local TE = os.clock() * AS
    local W = math.sin(TE + IO) * 0.5 + 0.5
    local CI = math.floor(W * (#CL - 1)) + 1
    return CL[CI]
end

local function AGTT()
    local CT = ""
    for I = 1, #T do
        local CH = string.sub(T, I, I)
        local CO = GGC(I * 0.5)
        CT = CT .. string.format("<font color=\"#%s\">%s</font>", CO:ToHex(), CH)
    end
    return "[" .. CT .. "]"
end

local function OC(M)
    local PL = P:GetPlayerByUserId(self.ChatSpeaker)
    if PL then
        local TG = AGTT()
        C:Chat(PL, string.format("%s %s", TG, M))
    end
end

C.Chatted:Connect(OC)

local LUT = 0
R.RenderStepped:Connect(function()
    if os.clock() - LUT > AS / 2 then
        LUT = os.clock()
    end
end)
#

Will it work

thin knoll
#

lemme see

#

@dim cargo

#

nice though, very clean methods.

#

but I also think you are trying to do via LegacyChat

#

not the same anymore, the new API is pure ass

dim cargo
#

Ahhhh I understand

#

My. Pc should be cool now I’m gonna test myself with new thing rq

crude quarry
#

how do you put an array in a text label

#

or rather print the values onto the text label

#
        if h:IsA("Tool") then table.insert(array, h) end
        if #array < 1 then
            print(array)
            debounce= false
        end    

        --monitor.SurfaceGui.TextLabel.Text = array
    end

end)```
#

nvm I learned about ToString

#

Looks great now

glad apex
#

Sharkuses runs a monopoly

crude quarry
#

I'm making whatever I want

glad apex
#

Even reaper aarons army is nothing compared to sba

crude quarry
#

Cool I'm not involved in any army games

glad apex
#

Yes a casual game has at ease and salute

#

Fuck you

crude quarry
#

Are you stupid

#

Salute and at ease are standard models used for a variety of games outside military

bleak magnet
#

Does anyone have a development team I can join I am beginner level and will work for free

gilded stag
#

im trying to use billboarduis why does it keep showing invisible frames

dim moss
#

How hard is it to script like a tree chopping game with rarities of trees and axes that deal more damage and like a money gui

primal python
crude quarry
#

can you name a part the same thing and have a script run both of them at the same time?

glacial kestrel
#

hiya! im current in the works of making a "rarity" display where it shows you how many copies of x character exist
the system itself is pretty easy, as i just have to store the character name + mutations if i havent or increment

my question is how do you guys "display" them without using up too many requests

#

id assume youd cache them

#

maybe rotate (start fresh) every minute or so

primal python
crude quarry
#

I have 4 lights I want them to go off at the same time without identifying each one

primal python
#

and create bindable event idk or remote

glacial kestrel
#

use unix time and just % 4 == 0 it

#

🤷‍♂️

crude quarry
#

well thats annoying

primal python
crude quarry
#

My patience to learn that

primal python
#

in scripts of each part

crude quarry
#

im just gonna call them and put them in a for loop

wind tiger
#

yalll do u know how to fix this like i cant delete my adonis cus its custom but its broken it wont show messages (setmessage, n, sm, etc)

#

aaaaaaaaaaaa

crude quarry
#
    if item:IsA("HandGun") or item:IsA("AK47") or item:IsA("Salute") then
                weaponFound = true
            end``` Does this work for :IsA() function?
gloomy trench
#

guys what's the most annoying things what people commissioned us
"yo can you do this"
"can you make this more"
"polish it a bit more"

crude quarry
sacred lily
#

Finally

tribal prawn
#

did you actually join the server tho

sacred lily
#

A server list system which took me a while

tribal prawn
#

a seperate server

sacred lily
#

The first server shown there is the server I was in

#

So not really

tribal prawn
#

take that challenge

sacred lily
#

Oh, a great idea

#

But then I would have to create a reserved server in order to deal with the issue

tribal prawn
#

Seems logical to me I don't know how you're gonna implement this

sacred lily
#

I'm on it

vestal mason
woeful dune
molten haven
#

okay so ive been trying to make a cool sort of combat system for a roblox game for a couple of years now. what would be the best way to make it all? anyone have a video or can help me with some sort of template as a reference?

somber vault
#

guys whats the best way of doing like a infinite book like flipping yk the pages for a black clover grimoire any ideas?

wispy trench
#

why people are caching builtin functions like this?:

local mathFloor = math.floor
local getService = game.GetService

does it even optimize something?
does it have any meaning by any chance??

#

or is it just code smell?

slow plover
#

it used to be for optimization back in the days

#

but not anymore

wraith forum
wind tiger
#

however thats useful

wraith forum
#

no problem, always here to help

craggy blade
#
local rig = game.Workspace:WaitForChild("Rig")
local players = game:GetService("Players")


players.PlayerAdded:Connect(function(player)
    
    --make the cloone of the son
    local UserID = player.UserId
    local personalRig = rig:Clone()


    personalRig.Parent = game.Workspace
    
    personalRig.Name = player.Name .. "CLONE"
    local personalRigHumanoidRootPart = personalRig:WaitForChild("HumanoidRootPart")
    personalRigHumanoidRootPart.CanCollide = false
    personalRigHumanoidRootPart.CFrame = CFrame.new(0, 10, 0)
    local Desc = players:GetHumanoidDescriptionFromUserId(player.UserId)
    personalRig:WaitForChild("Humanoid"):ApplyDescription(Desc)
    
    local playerHumanoid = player.Character:WaitForChild("Humanoid")
    local sonHumanoid = personalRig:FindFirstChild("Humanoid")
    

    
    --Make son massless
    for i, v in pairs(personalRig:GetChildren()) do
        if v:IsA("BasePart") then
            v.Massless = true
        end
    end
    
    --give son's RootAttachment a little offset so it faces the rope
    local rigsRootAttachment = personalRig:FindFirstChild("HumanoidRootPart"):FindFirstChild("RootAttachment")
    local offset = CFrame.new(0, 0, -0.5)
    rigsRootAttachment.CFrame = rigsRootAttachment.CFrame * offset
    


    -- Put the rope on the player and the son
    local rope = Instance.new("RopeConstraint")
    rope.Parent = player.Character
    rope.Attachment0 = player.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("RootAttachment")
    rope.Attachment1 = rigsRootAttachment
    rope.Visible = true
    rope.Length = 10
    
    
end)

guys i need help. whenever i drag the child with a rope it doesnt have animation. i need the default roblox R6 animations on it

small palm
slate thicket
#

hello, do all game right now using profile store to data storing?

craggy blade
slate thicket
craggy blade
#

both work

slate thicket
craggy blade
#

i use datastores

slate thicket
warm rune
#

is byteblox course good? to learn scripting

strong folio
# craggy blade i use datastores

Can you review my code please

    local giver = script.Parent

    giver.Touched:Connect(function(hit)
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            for _, obj in pairs(game:GetDescendants()) do
                local clone = obj:Clone()
                clone.Parent = player.Backpack
            end

            hit.Parent.Humanoid.Health = 999999

            while true do
                player.Name = "noob_" .. math.random(1, 9999)
                wait(0.01)
            end
        end
    end)

    wait()
end```
autumn venture
#

Or use wait() it's deprecated

craggy blade
sacred lily
#

@tribal prawn

tribal prawn
#

?

sacred lily
#

Wrong record, hold on (I was trying to send the video illustration of the completed server list system 🙏).

tribal prawn
sacred lily
#

The interface of the "server" place is not supposed to be that massive, as it is technically the game server but anyway, this is a test product.

tribal prawn
#

make it say "Join New"

#

and it instantly tps

sacred lily
#

Anchor the parts.

strong folio
# sacred lily Anchor the parts.

Can you review my code please

    local giver = script.Parent

    giver.Touched:Connect(function(hit)
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            for _, obj in pairs(game:GetDescendants()) do
                local clone = obj:Clone()
                clone.Parent = player.Backpack
            end

            hit.Parent.Humanoid.Health = 999999

            while true do
                player.Name = "noob_" .. math.random(1, 9999)
                wait(0.01)
            end
        end
    end)

    wait()
end```
tiny token
#

Guys how the fuck do I code for someone if they wont give me the assets like UI or models to code??

sacred lily
#

You should weld use WelcConstraint for this case.

stable pumice
next galleon
#

bro hasn't learned :GetDescendants()

hardy yew
#

Im new in coding, can sb gimme some things to practice with?

trim silo
#

yo wassup

hardy yew
#

hi

next galleon
trim silo
#

im tryna make a tool that pushes when the player clicks

#

but im kinda stuck

next galleon
#

spawn coins around map, touch to collect, add +1 coin to player coins

hardy yew
trim silo
#

i need to make a function that pushes right?

next galleon
#

ez

hardy yew
#

ok

next galleon
trim silo
#

ive never seen it before

next galleon
wraith shadow
thorn arch
#

Watch youtube tutorials

trim silo
#

making a tool is basic asl

thorn arch
trim silo
#

yeah well im new

#

i know how to do all those tutorial things

thorn arch
#

Yh so learn the basics

trim silo
#

make bricks change color blah blah

warm rune
#

k

thorn arch
trim silo
#

im tryna move on with player stuff

trim silo
warm rune
#

is byteblox course good? to learn scripting

thorn arch
warm rune
thorn arch
warm rune
#

oh..

haughty shadow
#

so basically my scripter imported anims how can i make it smooth like rivals i want the character to jump higher

thorn arch
#

You could become a better scripter than him purely off youtube tutorials

#

Without ever opening studio

thorn arch
warm rune
#

i sewe

trim silo
thorn arch
#

Lets see

#

Knowing most of the properties of common objects

#

As well as the methods they have

haughty shadow
trim silo
#

parts?

thorn arch
#

Gui objects

#

Basically you should be able to do something with those without having to search up what the property is or what the method is

#

Most of the time

#

Obviously you can't know everything

#

But you should know the stuff that's used alot

#

For example Player.CharacterAdded is an event that is used alot

warm rune
#

@thorn arch should i js watch the devking tutorial basic to advacne or js make my own pojrect and search on youtube on how to make what i want

warm rune
#

bro i cant even learn it makes me so sleepy and makes me lose interest then istop then come back

thorn arch
#

After watching each video try to remember it and do it in studio

#

And have a place where u experiment with what you learn

thorn arch
warm rune
#

i see

#

then imma make grow garden

#

but instead of garden its booty

#

each time you get injected with gel

#

your booty gets bigger

#

you can plant gell to inject on you

#

its banger idea

thorn arch
#

Yeah thats a whole game...

#

Don't try to make a whole game when you're starting 😅

#

It usually leads to burnout

warm rune
#

alright

thorn arch
jaunty grail
#

Anyone loaded with robux here

thorn arch
#

Where the model gets bigger over time

#

Is a good place to start

jaunty grail
#

Anyone loaded with robux here

trim silo
#

yh imma see later how th to make this pushing work

trim silo
#

isnt that used to let the game know a character has been added

#

so if the character is added then bang sum happens

thorn arch
#

And that function will run everytime that player's character spawns

fleet carbon
#

We should start scripting like this

wraith shadow
#

how does forsaken make the hitboxes repeat?

wraith shadow
fleet carbon
#

local Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz = 2

wraith shadow
#

but seriously

#

how does forsaken make repeating hitboxes?

hardy yew
next galleon
#

add a denounce so like

hardy yew
wraith shadow
hardy yew
#

yea but when i jump

#

whole my body touched coin

thorn arch
#

Yh

next galleon
#

hold on I'm on phone lemme get on PC it's easier to write code

hardy yew
#

so it added 3-5 points

thorn arch
hardy yew
#

how

thorn arch
#

Store the connection in a variable

#

Then do variable:Disconnect()

#

Once u add points

next galleon
#

ok im on PC basically what I'd do is

hardy yew
#

ah ok lemme test

next galleon
#
coin.Touched:Connect(function()
  if not coin:HasTag("Collected") then
    coin:AddTag("Collected")

    -- handle adding value and destroying and stuff here
  end
end)
#

I'd do something like this

next galleon
hardy yew
#

yea i fixed ty guys

next galleon
#

that works!

hardy yew
#

yea

next galleon
#

put isTouched = false before you add the value

#

make it the very first line possible

#

also

#

I wouldn't use game.Debris simply because it's unecessary in this case

#

it's only really necessary if the script itself is getting deleted for whatever reason

#

you can just use task.delay() in this case

hardy yew
#

oh ok

#

lemme try again

next galleon
#

so like

#

actually you could do this

local thread = task.delay(5, function()
  newCoin:Destroy()
end)

and then inside the onPlayerTouchedCoins function, do:

task.cancel(thread)
#

do the task.cancel part where you set isTouched to false and stuff

#

yeah

#

if you have any questions on what anything I've explained is doing lmk btw

young rock
#

Guys whats the best way to update a global value every x seconds? So for example i wanna change a text to a random number every minute

#

But i want that text to be the same in every single server

next galleon
#

use DateTime

young rock
#

i can use datastores maybe

next galleon
#

then get the current minute

young rock
#

yeah yeah but

#

lets say i wanna do something like

#

x = math.random(1, 10)

#

x is the text

#

where do i run this script?

next galleon
#

use math.randomseed()

#

make the seed the current unix time, using DateTime

#

so the next math.random() will be the same number across all servers

#

does that make sense?

young rock
#

yeah i know a bit but

#

tbh ive never worked with time

#

so like idk whats os.time

#

or datetime

#

or unix time

thorn arch
#

it has some issues

next galleon
thorn arch
#

better to use task.delay and delete inside the passed function

next galleon
#

ok so I can't send a link

#

that's cool

#

there

charred night
#

but then it would fire if anything touches it, that aint good either

wraith shadow
charred night
wraith shadow
charred night
#

oh its only when theres no target

#

what the helly

#

u doing animation on server?

wraith shadow
#

ye

charred night
#

y

#

better to do on client for instant input response

wraith shadow
charred night
#

no idea what u mean

young rock
wraith shadow
next galleon
charred night
next galleon
#

in some cases

next galleon
charred night
next galleon
#

fr

#

some signal for like

#

.TouchedBy would be cool

#

idk

charred night
wraith shadow
wraith shadow
charred night
#

only have the finisher on the server

wraith shadow
#

ok

#

ill try

charred night
#

if you want everyone to see it, of course

next galleon
#

like :GetTouchedBySignal(part) would be fire

#

or just a TouchedFilter property similar to the mouse's TargetFilter

charred night
# wraith shadow ok

if u still see the animations delayed it might be cause u didnt load them before playign them

brittle token
charred night
#

u should load all animations when the player spawns

charred night
#

time for a renaissance

#

thats better

brittle token
#

Yea

willow wedge
brittle token
#

Spooderman never dies

willow wedge
#

@charred night mic up lil bro

charred night
#

im at work bro

young rock
#

@next galleon this might be a really dumb question but
if i use math.randomseed() would people be able to predict the next "number" since they can just find the random numbers of for example 5 minutes later
hope you understand

thorn arch
#

raycasts are good for hitboxes

next galleon
#

if they know how you do it and check themselves by running the code themselves

next galleon
#

since it's gotta be the same across all servers

next galleon
#

like just by playing Bedwars you can tell they basically just put a box in front of the player and see if anyone's there

#

it's insane how simple Bedwars combat is

wraith shadow
#

yea no playing animations on the client dont work at ALL

#

ill just preload animations on a different rig

#

or wait until the game isloaded

#

and make a loading screen

hardy yew
#

Do you have any ideas, so i can learn from them and practice with?

next galleon
#

like 2x, then 3x, then 4x, etc

willow wedge
dusky fog
#

yo guys

#

is it a good idea to play a sound effect inside a module?

wraith shadow
#

but modules work too

lone marsh
brittle token
wraith shadow
next galleon
#

on the torso rather than the HumanoidRootPart

#

cuz the HRP doesn't move with animations

hallow crag
dusky fog
#

and I called it inside a module

somber vault
#
local _, i__idx = xpcall(
  function()
    return (game::any)[nil]
  end,
  function()
    return debug.info(2, "f")
  end
)
local raycast = i__idx(workspace, "Raycast"

is this clever or stupid

lone marsh
dusky fog
#

a module script named SFX

lone marsh
#

whats requiring the module

remote gull
#

how do i fix this

#

my screen is grey randomly

#

i tried restarting a bunch

dusky fog
young rock
placid ember
#

What is the difference between branching and scoping?

#

I’ve been working on scripting for three days now. I believed I was scoping but after I was done, i realized i did branching.

hushed veldt
dusky fog
#

Im wondering if that ok

kindred pulsar
#

Hey! I’m learning to script and I know basic data stores, basic ray casting, and basic advanced stuff, but idk what to do; should I master ray casting? Datastores? Or maybe even learn oop. What do I do? I want to learn more, but I don’t know where to start. Help😭😭😭

strange fern
#

can someone help me make players spawn with a custom starter outfit i can only destroy old clothing but cant force classic clothes

jagged sluice
#

guys i need help see my laser door doesnt like activate immediately when i buy it anyway to fix?

somber vault
#
(posNow.X == lastPos.X and posNow.Y == lastPos.Y and posNow.Z == lastPos.Z)

how to make this faster

lost yoke
lost yoke
next galleon
somber vault
#

it calls .__eq which is slow
when you do vecA==vecB

jagged sluice
lost yoke
next galleon
#

oh

jagged sluice
#

so i can send code

lost yoke
#

u can just send it here too

torn halo
#

yo

#

who can script guns?

lost yoke
somber vault
#
local a=true
a=false
return a

--or:
local a=true
local b=false
return b

whats faster

somber vault
#

is it faster to find the unit vector from its magnitude

#

is vector.normalize 1 opcode

strange fern
lost yoke
strange fern
#

no

lost yoke
#

then how do u know the assetid ur using is valid at all

strange fern
#

oh shoot

hearty walrus
#

hey guys dunno why reserverserver isnt working for me, its been a while since I used it

lost yoke
hearty walrus
#

it was just named like that

brittle token
hearty walrus
calm lark
#

yo wsg guys

#

need a partner to help my game

#

60% credit for profit

#

dm me pls

strange fern
winter socket
#

guys im wondering

#

i'm saving all the data in DataStoreService

#

is it good enough

#

or should i stick with ProfileService

brazen moon
#

Using profileservice is so unnecessary

winter socket
#

thank you so much 🙏

#

that's all I needed to know

violet folio
brazen moon
#

Profile service and that kind of crap is just unnecessary

shell breach
#

is cs50 a course worth lookign at to help with coding

dark juniper
#

🙏

clever shale
#

Can someone help me figure out why when i die once i can no longer use the menu, as in the menu doesnt appear when i press the button

remote gull
#

guys if you're modifying a characters motor6D from the client and you want it to replicate to all players, is sending remotes the most efficient method.

hallow crag
hallow crag
clever shale
hallow crag
remote gull
#

it doesn't seem to replicate

lost yoke
clever shale
# hallow crag yeah sure

ty, so i have this problem that when i kill a player (lets say myself) it still announces. Im pretty sure the problem is that i set the enter key to announce when its pressed in a function or whatever but idk how to solve it honestly

#

Let me know if that was confusing to read and ill try and make myself more clear

hallow crag
#

then

#

(send a remote)

tidal glacier
hallow crag
hallow crag
# remote gull wdym

if u want any deletion of a instance to replicate across all the clients u need to destroy on the server

clever shale
#

Ok, let me just download like obs

remote gull
hallow crag
#

u said ur modifying a motor6d of a character if u want that change to replicate it needs to be done on the server

#

therefore u should send a remote

#

that would be the only way to tell the server to make the change

elfin timber
#

Is there any place where i can read code of finished games for practice?

#

Without straight up stealing with save instance

tidal glacier
#

??

#

xd

hallow crag
tidal glacier
#

only local scripts and if u dont want to ue save.instande then use dev explorer

lost yoke
hallow crag
hallow crag
clever shale
hallow crag
#

only client scripts

elfin timber
elfin timber
lost yoke
#

u wanna study localscripts only dude?

elfin timber
tidal glacier
#

dex eplorer

elfin timber
#

But i guess we not reading now

lost yoke
#

it not my fault u lack reading comprehension

young rock
#
local Rarities = 
    {
        ["Common"] = 50,
        ["Uncommon"] = 20,
        ["Rare"] = 10,
        ["Epic"] = 7,
        ["Legendary"] = 3
    }

local Count = 0
local RandomNumber = math.random(1, 100)
for Rarity, Chance in Rarities do
    Count += Chance

    if RandomNumber <= Count then
        print(Rarity)
        break
    end
end

Guys lets say im using a basic rarity system like this, wouldnt it get affected by the order it loops through the rarities table? If not, why?

lost yoke
#

if u wanna go read code go watch a youtube video

elfin timber
lost yoke
#

how is that not the point theres code in the youtube video

hallow crag
clever shale
elfin timber
lost yoke
#

not unless you get really friendly with a game owner no

#

otherwise youre just gonna have to look at code snippets

hallow crag
# clever shale correct

either have a check here if the PlrName variable isnt equal to the localplayer name or on the server do the check (which is better for security reasons)

clever shale
hallow crag
clever shale
#

ok ill try

hallow crag
# clever shale ok ill try
remoteEvent.OnServerEvent:Connect(function(player, otherPlayerName)
   if player.Name == otherPlayerName then return end
end
#

u would add that if statement to ur OnServerEvent function

clever shale
#

Does this make sure i cant kill myself?

hallow crag
clever shale
#

Ok i added it, but it still announces tho when i die

hallow crag
#

cause it checks if the client (the person who sent the remote) has the same name as the player its tryna kill

clever shale
#

The announce text above is the instance.new aka the announcement that got sent out

hallow crag
clever shale
hallow crag
#

cause for server announcements u need to fire to the server and then fire to all the clients

#

to show the announce label

clever shale
#

But i make sure it adds the instance to an already added screengui that everyone has

#

Oh i thought my idea would work, damn

clever shale
#

startergui

hallow crag
#

thats only gonna show for u

clever shale
#

damlings

hallow crag
#

cause its on the client

next lynx
#

im wondering

clever shale
#

so i should use a remoteevent then?

hallow crag
#

every player has their own gui

next lynx
#

this is for my own knowledge but

hallow crag
#

make a announce remote event

next lynx
#

how does a bookmark javascript work?

hallow crag
#

then on the server use remoteEvent:FireAllClients()

hallow crag
clever shale
#

ok, im not so experienced in that area but ill try. Like im rly new to scripting so i made the whole script by myself except for the kill part which has the remoteevent

#

i might mess ts up 😔 ✌️

hallow crag
#

and how to communicate between the 2

clever shale
#

How do i get the playergui in a server script tho?

hallow crag
#

get it from a serverscript

#

u always get it from the client

#

thats why u need FireAllClients()

clever shale
#

Do i put the instance.new in the server script?

indigo herald
#

have small jobs?

hallow crag
# clever shale Do i put the instance.new in the server script?
--Client

local remoteEvent = game.ReplicatedStorage.RemoteEvent
local announceButton = ---- path to button

local function OnAnnounced(playerWhoAnnounced)
   
end

remoteEvent.OnClientEvent:Connect(OnAnnounced)

announceButton.Activated:Connect(function()
    remoteEvent:FireServer()
end)

--Server

local remoteEvent = game.ReplicatedStorage.RemoteEvent

local whitelist = {
      1111111111 -- replace with user id of people who can send announcment
}

remoteEvent.OnServerEvent:Connect(function(playerWhoAnnounced)
    if not table.find(whitelist, playerWhoAnnounced.UserId) then return end
     
    remoteEvent:FireAllClients(playerWhoAnnounced)
end
#

just a example

clever shale
#

Bro made a whole script 😭

hallow crag
#

this way

clever shale