#Vector3.new is not working proprely in my script
200 messages · Page 1 of 1 (latest)
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
no
just copy & paste
first i wouldnt put -- on everything so it actually works
also can i see where blkpos is defined?
like local blkpos =
i made a block and put its position to -160.865, 1.88, 105.239 and i got -160.865, 1.88, 105.239
is the position -160.865, 1.88, 105.239?
yes
i dont see why its not working
the remote is to check the block's position
but it gives Vector3.new(0,0,0)
instead of the block position
it prints right
but the Vector3.new won't work
as it's value is magically 0,0,0 not the part's position
show me
yesn't
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
it is
how does it not work
idk
it gives me the value 0,0,0
when the player touches the ticket
where do you use it that it magically turns to 0,0,0
i print it
yes that one
theres either another script that changes it
idk bruh from waht you gave me the value shouldnt change
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
from what you gave me the position of 'block' shouldnt change
try debugging or resetting your studio idk bro
bro
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?
aight i'm gonna fix it myself
is it here lua local args = { [1] = Vector3.new(blkpos) }
yes
couldve jsut said that bro 😭
and that Vector3.new
you dont need to put the Vector3.new
won't change to the blocks position
blkpos already has it
it's separed
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
wdym
nvm
did it work?
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
without the Vector3.new
yes
the value changes
no
what
konfuzion
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
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
tickets are blocks that spawn in the map
randomly
and i just wanna check for the position
but the vector3 won't work
modified it
try checking the table value
its a table
whith the vector3.new
HM
this is what i got
w8
with the vector3.new
ive been teeling you
blkpos = a vector3 value
NOT three number values :D
k 1 sec
yes but the vector3 has 3 values :D
just put [1] = blkpos
x,y,z
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.
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))
:)
what
just
do what i told you bruh
and it wont be equal to Vector3.new(0, 0, 0)
it isnt but
:)
you keesaying
you keep saying
a position = three numbers
but a position = a vector3
NOT
THREE NUMBERS
ay wait
so
wait
u saw the mess i just sent right?
nosir