#Vector3.new is not working proprely in my script

200 messages · Page 1 of 1 (latest)

pale hemlock
#

show script

hazy goblet
#
for _, block in pairs (workspace:GetChildren()) do
blkpos = workspace.block.Position
print(blkpos) -- -160.865, 1.88, 105.239
end
--[[
-- my remote
local args = {
[1] = Vector3.new(blkpos)
}
game:GetService("ReplicatedStorage").Events.Event.GetBlock:InvokeServer(unpack(args))
--]]

in the Vector3.new i'm getting 0,0,0 instead of -160.865, 1.88, 105.239

#

@pale hemlock

pale hemlock
#

when you print it?

#

can you show the whole script

#

like in the studio

hazy goblet
#

i messed up a line

#

mmm there

pale hemlock
#

bro did you write all of that

#

just to put it here

hazy goblet
#

no

pale hemlock
#

just copy & paste

hazy goblet
#

i did

#

so

#

how do i fix and why in my remote it appears as 0,0,0

pale hemlock
#

first i wouldnt put -- on everything so it actually works

#

also can i see where blkpos is defined?

#

like local blkpos =

hazy goblet
#

:)

#

look now

pale hemlock
#

can i see

#

where 'block' is

#

in your workspace

#

it works fine for me

hazy goblet
#

block is a part

pale hemlock
#

i made a block and put its position to -160.865, 1.88, 105.239 and i got -160.865, 1.88, 105.239

pale hemlock
hazy goblet
#

yes

pale hemlock
#

i dont see why its not working

hazy goblet
#

the remote is to check the block's position

#

but it gives Vector3.new(0,0,0)

#

instead of the block position

pale hemlock
#

it works fine for me, the exact same script you gave me

#

video is loading rn

hazy goblet
#

it prints right

#

but the Vector3.new won't work

#

as it's value is magically 0,0,0 not the part's position

pale hemlock
#

show me

hazy goblet
#

yesn't

pale hemlock
#

?

#

i cant help

#

if you cant show

hazy goblet
#

aight

#

screw it

for _, Ticket in pairs (game:GetService("Workspace").Game.Effects.Tickets:GetChildren()) do
TPos = tostring(Ticket.HumanoidRootPart.Position)
local args = {
[1] = Vector3.new(TPos)
}
print(TPos)
game:GetService("ReplicatedStorage").Events.Event.GetTicket:InvokeServer(unpack(args))
end
#

lmao

#

don't ask why it's local

#

i'm bad

pale hemlock
#

bro can you show

#

the whole script

hazy goblet
#

it is

pale hemlock
hazy goblet
#

idk

pale hemlock
#

like

#

how do you know

hazy goblet
#

it gives me the value 0,0,0

pale hemlock
#

it doesnt work

#

when on the script

#

do you use it

hazy goblet
#

when the player touches the ticket

pale hemlock
hazy goblet
pale hemlock
#

the print is fine

#

youre not showing the full script

hazy goblet
#

yes that one

pale hemlock
#

theres either another script that changes it

hazy goblet
#

no

#

that's all of it

pale hemlock
#

idk bruh from waht you gave me the value shouldnt change

hazy goblet
#

but it won't take the string of thr ticket position

#

and it gives me 0,0,0 instead of -160.865, 1.88, 105.239

pale hemlock
#

from what you gave me the position of 'block' shouldnt change

#

try debugging or resetting your studio idk bro

hazy goblet
#

yes but the Vector3.new won't take that value idk why

#

and it resets it

pale hemlock
#

where are you using

#

the vector3 value

#

its only on the print

#

and when you set it to that

#

i dont see anything else

#

can you like record a video of it not working?

hazy goblet
#

aight i'm gonna fix it myself

pale hemlock
#

is it here lua local args = { [1] = Vector3.new(blkpos) }

hazy goblet
#

yes

pale hemlock
#

couldve jsut said that bro 😭

hazy goblet
#

and that Vector3.new

pale hemlock
#

you dont need to put the Vector3.new

hazy goblet
#

won't change to the blocks position

pale hemlock
#

blkpos already has it

hazy goblet
#

it's not the same script

pale hemlock
#

blkpos = Vector3.new(-160.865, 1.88, 105.239)

#

not

hazy goblet
#

it's separed

pale hemlock
#

blkpos = -160.865, 1.88, 105.239

#

blkpos is equal to a vector3 value not three number values

#

you dont need to put Vector3.new

pale hemlock
hazy goblet
pale hemlock
hazy goblet
#
for _, block in pairs (workspace:GetChildren()) do
print(blkpos) -- -160.865, 1.88, 105.239
end
--[[
-- my remote
local args = {
[1] = Vector3.new(workspace.block.Position)
}
game:GetService("ReplicatedStorage").Events.Event.GetBlock:InvokeServer(unpack(args))
--]]
#

i could do this

pale hemlock
#

without the Vector3.new

hazy goblet
pale hemlock
#

no

hazy goblet
#

yes

#

as there are more tickets all over the map

#

that spawn

pale hemlock
#

what

hazy goblet
#

konfuzion

pale hemlock
#

dude

#

i am not you

#

i dont know what those tickets are

hazy goblet
#
for _, Ticket in pairs (game:GetService("Workspace").Game.Effects.Tickets:GetChildren()) do
local args = {
[1] = Vector3.new(Ticket.HumanoidRootPart.Position)
}
print(TPos)
game:GetService("ReplicatedStorage").Events.Event.GetTicket:InvokeServer(unpack(args))
end
pale hemlock
#

all i knwo is ```lua
for _, block in pairs (workspace:GetChildren()) do
blkpos = workspace.block.Position
print(blkpos)
end

local args = {
[1] = Vector3.new(blkpos)
}
game:GetService("ReplicatedStorage").Events.Event.GetBlock:InvokeServer(unpack(args))

for _, Ticket in pairs (game:GetService("Workspace").Game.Effects.Tickets:GetChildren()) do
TPos = tostring(Ticket.HumanoidRootPart.Position)
local args = {
[1] = Vector3.new(TPos)
}
print(TPos)
game:GetService("ReplicatedStorage").Events.Event.GetTicket:InvokeServer(unpack(args))
end``` this is your script and it isnt working

hazy goblet
#

tickets are blocks that spawn in the map

#

randomly

#

and i just wanna check for the position

#

but the vector3 won't work

pale hemlock
hazy goblet
#

it prints

#

but

pale hemlock
#

without the vector3.new see

hazy goblet
#

try checking the table value

pale hemlock
hazy goblet
#

whith the vector3.new

pale hemlock
#

yes

#

i will

#

rn

hazy goblet
#

HM

pale hemlock
#

this is what i got

hazy goblet
#

w8

pale hemlock
#

with the vector3.new

#

ive been teeling you

#

blkpos = a vector3 value

#

NOT three number values :D

hazy goblet
#

k 1 sec

pale hemlock
#

so you dont need

#

the Vector3.new()

hazy goblet
pale hemlock
#

just put [1] = blkpos

hazy goblet
#

x,y,z

pale hemlock
#

omg

hazy goblet
#

i'm testing

pale hemlock
#

just

#

do [1] = blkpos

#

bro

#

on the script

#

YOU GAVE ME

#

blkpos = workspace.block.Position

#

AND A POSTIION VALUE

#

IS = VECTOR3.NEW(X,Y,Z)

#

which is why ive been telling you to not put the vector3.new :)

#

do you get it now?

#

blkpos = game.Workspace.block.Position = Vector3.new(-160.865, 1.88, 105.239) AND NOT blkpos = game.Workspace.block.Position = -160.865, 1.88, 105.239

#

please tell me you get it now.

hazy goblet
#
for _, Ticket in pairs (game:GetService("Workspace").Game.Effects.Tickets:GetChildren()) do
local TPos = Vector3.new(Ticket.HumanoidRootPart.Position)
local args = {
[1] = TPos
}
print(TPos)
game:GetService("ReplicatedStorage").Events.Event.GetTicket:InvokeServer(unpack(args))
end
-- the remote =
local args = {
    [1] = Vector3.new(0, 0, 0)
}
game:GetService("ReplicatedStorage").Events.Event.GetTicket:InvokeServer(unpack(args))
#

:)

pale hemlock
#

what

hazy goblet
#

magic

#

still won't work

pale hemlock
#

just

#

do what i told you bruh

#

and it wont be equal to Vector3.new(0, 0, 0)

#

it isnt but

hazy goblet
#

:)

pale hemlock
#

you keesaying

#

you keep saying

#

a position = three numbers

#

but a position = a vector3

#

NOT

#

THREE NUMBERS

hazy goblet
#

ay wait

pale hemlock
#

so

hazy goblet
#

wait

pale hemlock
#

you dont need the Vector3.new()

#

and you can just put

#

blkpos or wtv

hazy goblet
#

u saw the mess i just sent right?

hazy goblet
#

dam

pale hemlock
#

no

#

i answered with the message you deleted

#

no

#

bro

#

oure tryna exploit?

#

bruh

hazy goblet
#

nosir

pale hemlock
#

im not helping you

#

im glad youre struggling

hazy goblet
#

i'm joking aaaa

#

high quality WHAT?

#

dam ppl can't be joking these days