#Attempt to index nil with pivotto???

1 messages · Page 1 of 1 (latest)

solar blade
#
local des = script.Parent:FindFirstChild('Destination')
local reference = game.Workspace.reference
local rad = math.rad
local rotatAmount = 1
while wait(13) do
    des:PivotTo(reference.CFrame + Vector3.new(math.random(-100, 100), math.random(-20, 20) , math.random(-250, 250)))
    local newCFrame = des.PrimaryPart.CFrame * CFrame.Angles(-math.random(-45, 45), -math.random(-45, 45), rad(-math.random(-45, 45)))
    des:SetPrimaryPartCFrame(newCFrame)
end```
#

it just said attempt to index nil with pivotto

#

and then breaks

#

womp womp

keen whale
#

wtf is des

#

Is it a moddel?

pearl berry
#

maybe des doesnt have a pivot

pearl berry
keen whale
#

Either des doesn't exist or you're trying to use :PivotTo on something that ISN'T a model

solar blade
solar blade
#

a different script changes the name of things to destination cycling through a list of destinations

#

well

#

2

#

I'm scrapping off a moving platform script I liked

#

Des is a regular part

torn robin
#

u use pivotto on models

#

not part

solar blade
#

ooooooohhhhhhhh

#

wait

#

so

#

if I group it as a model

#

does that work?

torn robin
#

yeah

#

but u could just set the parts cframe

solar blade
#

no wait that breaks the other script

torn robin
#

part.cframe = cframe.new()

solar blade
#

ahh

#

I will try that

torn robin
#

or well in ir case

pearl berry
#

But why the hell doesnt :PivotTo() work

#

It should work for parts

torn robin
#

part.cframe = reference.cframe + vector3.new()

solar blade
#

running rn

#

I'll tell yall if it works

#

thank u :3

torn robin
#

it is for parts too i forgot

keen whale
#

It shouldn't be

torn robin
#

do waitforchild

#

not findfirst

#

@solar blade

#

then it’ll prob work with pivotto

solar blade
#

?

#

ok

#

wa

pearl berry
keen whale
solar blade
#

but I already changed from pivot

keen whale
#

Yeah I'm wrong

pearl berry
#
script.Parent:PivotTo(CFrame.new(5,10,5))

ts worked for me

#

and Parent is a part

solar blade
#

now it says

#

attempted to index nil with Cfram

#

e

torn robin
#

do the waitforchild

#

where u reference des

solar blade
#

k

torn robin
#

and try again

pearl berry
torn robin
#

it used to be for models only

#

where it’d change primarypart cframe

solar blade
#

COME ON BABY

#

WORK

#

...

#

"Argument one missing or nil"

#

?!?!!?!?!?!?!?!?!?!

#

oh I see

#

code autocorrect

#

added a second set of brackets

keen whale
#

So PivotTo works

pearl berry
solar blade
#

?

#

I aint

pearl berry
#

alr alr

solar blade
#

ok now it says infinite yield possible

#

I HAVE AN IDEA

#

SINCE THE DESTINATION CYCLER

#

CYCLES THROUGH THE LIST

#

AND CHANGES THE NEXT ONE

#

TO THE NEXT NUMBER

pearl berry
#

bro gets 5 diffrent errors in the same script how is that even possible

solar blade
#

I CAN CHANGE IT TO LOOK FOR DESTINATION 2

#

MUAHAHAHA

pearl berry
solar blade
#

(I've been scripting for 5 years and this is embarrasing)

pearl berry
#

it is

solar blade
#

I FIGURED IT OUT

pearl berry
#
--!strict

export type Core = {
    DEBUG: boolean,
    _VERSION: string,
    test : () -> ()
}

local _core : Core = {
    DEBUG = false,
    _VERSION = "0.1",
    test = function() end
}

_core.test = function()
    print("working")
end



local core = setmetatable({}, {
    __index = _core,
    __newindex = function(_, key, newvalue)
        
        if key:match("^_") then
            error(`\n{key} is read-only`)
            return 
        end
        if typeof(rawget(_core, key)) ~= typeof(newvalue) then 
            error(`\n{key} assigned wrong type: \nexpected: {typeof(rawget(_core, key))}, \ngot: {typeof(newvalue)}`)
            return 
        end

        _core[key] = newvalue
    end
})
return core

ts is my progress after like 3 yearsrizz

solar blade
#

wowza

#

maybe I should have read tutorials

#

instead of just

#

scripting

torn robin
#

how tf r u 5 years deep and stuck on output errors

#

no offense

#

😭

pearl berry
torn robin
#

if he’s just been freestyling luau without tutorials then that’d make sense but would b dumb of him

#

so much to learn from even the shortest of tutorials

solar blade
#

:(

#

I am

#

dum

#

I mean I do watch tutorials sometimes

#

but

torn robin
#

@solar blade if u wanna learn more u should go indepth with brawldevs series’

#

and after that just freestyle on ur own and when u think of a cool idea but not 100% sure on how to do it

#

either ask sum1 smarter in the language or use ai

pearl berry
#

bro hes stuck on the like basics for 5 years likeevilcat

torn robin
#

don’t let ppl say ai is bad for learning it’s great if u use it to LEARN not code for you

fluid ocean
#

stare at roblox docs until all you can see when you close your eyes is the roblox docs and all you can dream and think about is roblox studio and variables and errors and misery

torn robin
#

i woke up today

fluid ocean
#

👍

torn robin
#

thinking about functions

#

for some reason

fluid ocean
#

valid

torn robin
#

i was working last night on my time project

#

on this petrification ray

pearl berry
torn robin
#

based off dr stone

fluid ocean
#

bro on god

torn robin
#

honestly a good way 2 be more into lua

fluid ocean
#

all i think about is optimisation and modularising script atp

torn robin
#

tears of sadness when i see a game like grow a garden with millions active

#

a game made in a week

fluid ocean
#

most popular game in the world btw

#

BY FAR

torn robin
#

and then games that dedicated years of their lif

torn robin
#

life

pearl berry
#

yo pls check this out

torn robin
#

tens of thousands of lines

pearl berry
#

🥀🥀

fluid ocean
solar blade
#

like

#

random ah wording

pearl berry
solar blade
#

zam

#

I've been working on my game

#

which is coming along epically

torn robin
#

@solar blade whats ur game abt

pearl berry
solar blade
#

uh

#

u get stuck in a facility

#

and u use a time machine

#

to solve puzzles and escape

#

I'm spending sooo many hours on this

pearl berry
solar blade
#

what

#

what don't you get?

#

it's like

#

pivot to vs bloody

#

uh

#

cframe.new

#

or

#

brickcolor vs color

torn robin
solar blade
torn robin
#

like 5 days ago i randomly thought abt making time abilities like rewinding and timestopping with partial effects

#

so i made them

#

and polished in everyw ay possible

#

so im thinking abt making a game where

#

the person with the most hours has this timelord status where they bave these abilities based around manipulation of time

#

and every1 else fights him

#

and whoever kills him is the new one

candid talonBOT
#

studio** You are now Level 7! **studio

torn robin
#

and u can use ur time spent ingame to buy new weapons to fight him

solar blade
#

interestin

torn robin
#

and of course i’d make it so u can buy time or be the next timelord automatically with robux

#

🥺

solar blade
#

ofc

#

ofc

#

lol

solar blade
#

can u help me with another thing pretty pleaaaseee

torn robin
#

what thing

solar blade
#

Cframe is all multiply and add and what not, I wanna go from 0 on angles so I can have random angles from 0 to 45, but if I go from 0, the POSITION also goes from 0.

#

which breaks the whole thing :(

pearl berry
#

local newCFrame = oldCFrame * CFrame.Angles()

solar blade
#

but

#

doesn't that just

#

that's not usually how multiplication works

#

like

#

but ok

#

I trust you

#

wise man

pearl berry
#

For CFrames * is like for Vektors +

torn robin
#

mb i was lowk on tiktok

torn robin
solar blade
#

oh ok so

#

so multiply just means set in stone

#

very cool

#

thanks!

pearl berry
#

in which applications do you use stone?

torn robin
#

what

pearl berry
torn robin
#

it’s a saying

#

“set in stone” as in it doesn’t move or it’s exact

#

dats what he meant if ur talkin ab that

crystal dagger
#

how did yall turn Nil to 200 message story

#

when its like naming problem or whatever

pearl berry
#

I think he means

local newthingy = a set b
local newthingy = a * b
pearl berry
#

we just chilling

crystal dagger
#

even tho i once spent i think 200 or 500? i forgot

#

messages

#

explaning return

pearl berry
solar blade
#

lol

#

500messages for return

solar blade
#

erm

#

ok spamdetection

#

thanks for deleting that...

#

but REESES, my buddy pal friend chum amigo homeslice breadslice dawg, you wouldn't mind helping me out with another little script riiiiight?

#

:3

#

nvm got it

candid talonBOT
#

studio** You are now Level 13! **studio

solar blade
#

lol

#

sory

pearl berry
#

y still need help? @solar blade

urban plume
#

Is there any other scripts that is deleting reference