#PlayerModule not found ingame

1 messages · Page 1 of 1 (latest)

fossil elk
#
local player = game.Players.LocalPlayer
local pModule = require(player.PlayerScripts:WaitForChild("PlayerModule")

print(pModule)
print(pModule:GetControls():GetMoveVector())

In studio, this prints out the player module and the vector
but when I tested this in the published version, it doesn't print anything.

Is there a fix for this?

light crescent
#

U mean It works on studio but not on a real roblox server

#

What is the parent of the script

fossil elk
#

starterplayerscripts

#

i tried both character and player scripts

#

😔

light crescent
#

Try printing the children of the playerscripts

fossil elk
#

alr

light crescent
#

Try It on a while true do loop

#

And add a task.wait(1)

#

So it doesnt Crash ur Game or fill Up the output

fossil elk
#

also something weird is that i had it print out a module on its own

#

and then the required module variable

#

it would print out the former not the latter

#

so it prints out table here

#

which is a table of playerscript's children

#

but when you require it, it doesn't print

#

or do anything

#

anything below it just doesn't run or idk

light crescent
#

Oh ye forgot abt that on the Game output just prints the table memory adress

fossil elk
#

ya i had it print out the modulescript itself just incase

#

so it CAN find the module

light crescent
#

But when u require the module It just returns an empty table?

#

Or It returns nil

fossil elk
#

doesn't even print i think

light crescent
#

Try like printing any of the function of the module

#

I mean

#

print(playerModule.GetControls)

fossil elk
light crescent
#

Sometimes when u print a table It doesnt print anything

#

Even the memory adress

#

Maybe thats the situation

fossil elk
#

before I added that third print , it wouldn't even print the last two prints

light crescent
#

No i dont mean that

#

If It doesnt print anything

#

Try setting the position of a part to the direction returned by the getMoveVector function

#

Idk what to do

fossil elk
#

im setting the getmoveVector to a velocity

light crescent
fossil elk
#

no

#

it works in studio only

light crescent
#

Wait so

#

It gets the module but the functions that should returns smt dont return anything?

fossil elk
#

🤷‍♂️ , from what I'm seeing, it can get the instance, but it's not able to require it/use its functions

light crescent
#

Did u changed smt inside the module

fossil elk
#

so you can do playerscripts.playermodule, but require(...) doesn't work for it

fossil elk
#

i tried making a copy of it and inserting it in starterplayerscripts, but same issue

light crescent
fossil elk
light crescent
#

Huh

#

How printing the module table just returns the table memory adress

#

Try printing every thing inside the table on a for i, v loop

fossil elk
#

the table memory address is from the table of playerscripts children

#

it doesn't even print the module table at all

#

😢

light crescent
light crescent
fossil elk
#

alright

#

okay so in studio, this prints two tables, in roblox it doesn't 😔

light crescent
#

Make like a recursive function

#

Where It does that but when the value is a table It calls the function again on the table

#

Also print the Index so we can have more info

fossil elk
#

same issue 😔

#

nothing prints

light crescent
#

Send the function that u used

fossil elk
#

It checks if v is a table or not

#

If yes, then it does it again to require(v)

#

If no then it prints (I, v)

light crescent
#

Wait u cant require a table

fossil elk
#

Ah

#

Lemme change it rq

#

The weird thing is that this works fine in studio

#

The thing moves etc

light crescent
#
for i, v in t do
 if type(v) == "table" then
 recursivePrint(t)
 else
  print(i, v)
 end
end```
#

Srry for bad Code im on mobile rn

fossil elk
#

It’s alright

fossil elk
#

It’s like requiring it just doesn’t make it run at all

#

Blank

light crescent
#

What thats impossible

#

Try doing #table instead

#

So it print the count of the table

#

If It doesnt print anything or It prints an error

#

Maybe its not returning a table at all

#

Or the require fails but It doesnt output the error

fossil elk
#

When I tested this in the multiple players studio test

#

It also didn’t work, but it used to work when it was just the movement system, but when it took longer to load, it wouldn’t work

light crescent
#

Im starting to think its an error on ur Code and not the require

#

Oh nvm

fossil elk
#

I was thinking the custom camera system might have had something to do, but then the system shouldn’t work in studio either

light crescent
#

Anything that u put above the require line print to the output right?

fossil elk
#

The reason why I’m using the module instead of humanoid movevector is that there isn’t a humanoid 😭

light crescent
#

Try printing smt that its not a table 1 line after the require line

fossil elk
light crescent
fossil elk
fossil elk
light crescent
#

Even if its a print("Hello world")

fossil elk
#

No

#

It wouldn’t even print nil for the vector

light crescent
#

Alr the maybe its bc of ur camera system confusing the roblox camera module or smt

#

But wait

fossil elk
#

In studio

#

If it’s an error, it shouldn’t work in studio and in client

light crescent
#

Does ur custom camera system work with the custom cameraType or with any other cameraType like Scriptable

light crescent
fossil elk
light crescent
#

Try in an empty baseplate

#

Maybe the problem comes from any script on ur Game or smt

fossil elk
#

Alrighty, I’ll have to finish some stuff up and then I can try playing around with the module

#

On an empty baseplate

#

I’ll post results here

light crescent
#

Aight

fossil elk
#

Okay so this is odd

#

I wrote a script on the new baseplate

#

and it detects the inputs

#

huh

#

apparently the reason it didn't work was because of the animation constraint thing

#

since it's still beta