#How send Workplace Parts over to another script.

1 messages · Page 1 of 1 (latest)

south kestrel
#

I’m trying to make parts send from a script to a different script by using bindable events but all I’m getting is the name of the part and not the actual part where I can change the position and stuff. So I’m wondering how I would do that and actually be able to change the properties of the part. (Can’t use bind functions either)

south kestrel
# past imp show scripts

What I’m doing can’t work, so I’m asking if there is something else I can do that will work (so no need to show scripts)

broken bane
#

What do you mean send from one script to another?

south kestrel
#

like bindevent:Fire(part)

#

bindevent.Event:Connect(function(part)

#

what i mean

#

but that does not work

past siren
#

why not get the part from workspace normally

south kestrel
#

cuz then I would have to write literally 6000 lines of code to include each part

past siren
#

iterate through a table of parts

south kestrel
#

i dont use tables, wym?

past siren
#

tables are a data structure in roblox that store objects like instances strings numbers and even other tables

#

you should learn about them if you want to get better at scripting

#

it should be in the documentation

south kestrel
#

how would I do that?

broken bane
#

game:GetService("RunService").Heartbeat:Wait()
local event=game:GetService("ReplicatedStorage"):WaitForChild("Event")
local Part=workspace:WaitForChild("Part")
local Pos=Vector3.new(10, 10, 10)

event:Fire(Pos, Part)
ServerScript1


local event=game:GetService("ReplicatedStorage"):WaitForChild("Event")

event.Event:Connect(function(pos, part)
part.Position=pos
end)
ServerScript2

past siren
#

for i, v in tableName do

#

i will be either keys or the index

#

v will be the values

#

but you can use ipairs more specifically to get the index if its an array and pairs to get the key if its a dictionary

south kestrel
#

seen for i, v inpairs before but never understood it

#

gues i gotta lock in

broken bane
#

Do you know what is OOP?

south kestrel
#

no?

broken bane
#

Object Oriented Programming

#

Looks like this
local Monster={}

#

Monster=__index=Monster

#

function Monster.new(model)
local self=setmetatable({}, Monster)

#

return self

#

If you will learn this you will be strong in scripting

south kestrel
south kestrel
past siren
#

if you send your script it would be easier to understand what you're trying to do

broken bane
#

You want for like 10 part to do a tween position like in first example?

#

I can write

past siren
#

like are you creating new parts or something or do they already exist

broken bane
#

So what do you want exectly?

gentle cloakBOT
#

studio** You are now Level 2! **studio

south kestrel
# broken bane So what do you want exectly?

so when I click a equip button, I want a remoteevent to fire and send the parts that are connected to that equip button over to the server and the server to do what the ss i sent it doing with the current parts (ill chnage like redcan1 and stuff to just can1 to give a more neutral identity)

broken bane
#

From redcan1 to redcan1lid is the parts you want to send?

#

What exactly this script do?

broken bane
#

Explaing the code so I can frame the problem

#

And solution

south kestrel
past imp
past imp
#

the indentation

#
  • light mode
south kestrel
#

ive never change whatever mode the application comes with

broken bane
#

Can you send full code?

south kestrel
past imp
#

OMG

broken bane
#

OMG

past imp
#

GIF THIS SHIT RN

#

OMG

broken bane
#

wtf

past imp
#

HOLY SHIT

broken bane
#

I thought i shit code

south kestrel
#

this is literally peak coding is it not?

broken bane
#

Module scripts fears you

south kestrel
#

i dont know how to do that tbh

broken bane
#

where do you want here to send the parts?

past imp
#

never heard of a function in his life

broken bane
#

Because I can't understand a shit in here

south kestrel
#

thats after ive got the parts

broken bane
south kestrel
#

this is where im sending the parts from

broken bane
#

Where the green one or the yellow?

south kestrel
#

what r u asking?

broken bane
#

Where do you want to send parts, I'm looking at the code and feel pain

south kestrel
#

at the very top

#

and then the rest of the function deals with the parts

south kestrel
fading stone
#

i hardcode everything i make

#

(joke)

fading stone
#

you cant reuse any of that

broken bane
#

local Event=game:GetService("ReplicatedStorage"):WaitForChild("YourEventName")
add da shit in top of the script
Event:Fire(redcan1, redcan1bottom, redcan1glass, redcan1lid)
and this here

fading stone
#

and youre stacking things unnecessarily

south kestrel
fading stone
#

okay..?

#

i dont mean reuse in other game

#

s

south kestrel
#

and if i need to use it again cant I just copt paste and change names?

fading stone
#

what

#

im never touching this channel again 🥀

broken bane
#

LOl

#

Da shit is cursed

south kestrel
fading stone
#

what do you do if you wanna make a new weld

south kestrel
#

instance.new("Weldconstraint")

#

parent

#

part1

#

part0

fading stone
#

now

#

what if you can compress ALL of that

#

into

#

makeWeld(parent, part0, part1)

#

or makeWelds({{ parent, part0, part1 }, { parentA, part0A, part1A }})

past imp
broken bane
#

I don't think he's know what function is

past imp
#

thats insane

south kestrel
#

but then how would it know what parts id be talking about

past imp
#

holy

south kestrel
past imp
#

alvin blox videos stat

#

This Roblox How To Code tutorial will teach you how to script on Roblox for beginners. Roblox Coding or Scripting in Lua is very easy to learn and I've got years of experience to share with you so you can learn how to code a game on Roblox. A lot of people want to know how to learn Roblox scripting and this is the best place to start. We go over...

▶ Play video
#

start this

fading stone
rocky wharf
south kestrel
past imp
past imp
south kestrel
past imp
#

just watch them all

#

absorb them and do it with alvin

south kestrel
#

outdated

past imp
#

you are coding like you are 5 years old

#

its okay

fading stone
#

"out dated"

past imp
#

code doesnt change that much

#

it doesnt matter

past siren
#

it still teaches the fundamentals

south kestrel
#

but i feel like ik the fundamentals

past imp
#

i thought functions was programming 101

past imp
#

you dont

past imp
#

we are telling you that you dont

south kestrel
#

how is that not fundimentals

past imp
#

go watch the video

#

go watch the videos

fading stone
past siren
fading stone
#

i dont think he's gonna understand that

south kestrel
south kestrel
past imp
#

BRO

fading stone
past siren
#

but it could be made shorter and more legible

#

easier to expand upon

past imp
fading stone
#

thats like making a car work and saying "but it works," then it breaks down the next day

past imp
fading stone
#

its called performance

#

i dont think your code is a fan of that

past imp
fading stone
#

that too

past imp
#

everything doesnt give you an error

past imp
#

watch the video

#

we know better

#

why arent you listening

fading stone
#

"weldcartodoor1021021392139123012302_BA21219312"

south kestrel
past imp
#

no

fading stone
#

waist of time

past imp
#

its not a waste of time

#

you are waste of space

#

go watch the videos

fading stone
#

whats your first language btw @south kestrel

south kestrel
#

...

#

laua

#

ive never coded before this

fading stone
past imp
#

so listen to us

#

and watch the videos

#

and use functions

fading stone
#

why does he speak an extinct language

south kestrel
#

i feel like yall just saying do something like

past imp
fading stone
#

oh

#

whoopsies

#

oh

past imp
#

your code is ass

fading stone
#

thats not what i meant by language brother 😭

#

is your best language english?

fading stone
past imp
#

no, hes just under 13

#

thats why he cant spell

fading stone
#

thats what im thinking

past imp
#

look at his profile

fading stone
#

but maybe theres hope

#

yyeah im aware

#

i cant even say anything about his profile

#

because its entirely political

#

😭

past imp
#

the religious stuff is okay but idk

#

bout the rest

fading stone
#

yeah

past imp
#

should just let the man rest in peace

south kestrel
#

how is it political 😭

past imp
#

its like putting the blm thing on your pfp

#

like you are helping

fading stone
#

exactly

fading stone
#

do you know what political means timmy

south kestrel
#

how is saying a man is the best role model political thing?

fading stone
#

role modal polital

fading stone
#

🤷

#

thats just how it is

#

i digress from the main point

#

go watch those videos on scripting it'll help

#

thedevking is also pretty good

#

im pretty sure atleast

south kestrel
fading stone
#

part3

#

?

#

but yeah thats a function

#

and its there correctly

south kestrel
#

yo chat

#

u may of just solved my problem of not wanting to write 6k lines of code

#

thx

past imp
#

maybe listen to people next time

fading stone
#

dont bite the hand that feeds you

past imp
rocky wharf
#

i've only seen you whine and argue

#

can you say something respectful or remotley helpful to this world

past imp
#

he was saying he didnt want to use a function

#

and me and the other guy were telling him to

rocky wharf
#

no code can justify such hostility

past imp
#

yes it can

rocky wharf
#

people arent going to be as good at studio as you

#

so dont just get mad when they dont instantly learn years of hard work

#

we all started somewhere, i was as stupid as him six months ago

past imp
#

we were trying to help and he kept going against it

rocky wharf
#

ok i didnt actually read the messages so i might be judging without enough evidence

#

i should probably look up a bit

past imp
#

what a drone

gentle cloakBOT
#

studio** You are now Level 15! **studio

rocky wharf
past imp
#

literally some people deserve it

#

he had that

#

and was questioning

#

why he should use a function

rocky wharf
#

can i ask what this is supposed to do

past imp
#

and waste time making code look good

#

like??

past imp
rocky wharf
#

i dont really even understand what the title is saying

past imp
#

he wants to use bindables

rocky wharf
#

ah well he'll probably learn more in the future

past imp
rocky wharf
#

then my game was incredibly laggy and used up a ton of processing from the server

#

and good computers and wifis averaged 200-300 ping when they normally get 50ms in most games

#

i ended up discontinuing that game

#
  • if you want to change anything good luck
south kestrel
#

Ik how to use bindables

past imp
#

its actually a good thing that you did mkae this

#

if you kept unironically coding like that

#

yeesh

south kestrel
gentle cloakBOT
#

studio** You are now Level 11! **studio

south kestrel
#

My amazing code?

rocky wharf
#

yur

south kestrel
#

When a player loads in it welds 9 small invisible parts to their character in different locations

#

Ik how to make it shorter now

#

don’t spam at me pls 🙏

south kestrel
# past imp then why did you even make this

Cuz I wanted to know how to send a part from workspace over from a local script to a server script without having to write 6k lines of code but now I’ll just use functions which I didn’t know could work like that so u unintentionally solved my problem

past imp
#

your shitty code and this doesnt correlate

#

these are 2 seperatre issues

#

i hope yk that

rocky wharf
#

infact i think they're the only way you can

south kestrel
south kestrel
#

also i made it like this

rocky wharf
fading stone
rocky wharf
#

IS HE CHANGING THE CFRAME AND THEN THE POSITION???

#

you only have to change 1

#

oh nevermind hes doing +=

#

i thought that was =

south kestrel
south kestrel
past imp
south kestrel
#

im not jokin thats my code

#

(idk how to make better 🤷‍♂️ )

south kestrel
#

(friends idea tho)

rocky wharf
#

i actually cant bro

stoic oar
south kestrel
rocky wharf
#

i cant even look at this