Some Roblox update killed local StarterPlayerScripts?

Especially on StarterPlayer/StarterPlayerScripts, some scripts don’t seem to work anymore after i updated roblox and studio, they weren’t like this before the update, on studio everything works perfectly fine but on public it doesn’t. You do get these errors now from the StarterPlayerScripts, it shows it on the ‘client’ console:

image

Id like to know if everyone is also having local script errors and that this is an actual bug :wave:

1 Like

Could you provide the code? This could be the code causing the issue, I haven’t had an issue with StarterPlayerScripts, I use it just fine for so many things.

1 Like

This could be related to the new Lua VM being turned on in production. You said it wasn’t occurring in studio, so can you go into studio -> File -> Beta Features and switch the Lua VM on. If the issue starts occurring in studio, that’d confirm it.

Other than that, could you provide the source of the StarterPlayerScript file?

Cheers.

1 Like

byc, He could be not part of the Beta program, you have to opt in to be in it. If he’s not in it, then it’s most likely his code, he hasn’t provided it so I think we are all confused what this could be linking to.

2 Likes

They are enrolled in the Beta program.

2 Likes

You’re right i switched the Lua vm on and now the same thing is occurring like in the public game, so what does this really mean tho’.

1 Like

Reply to this topic with specifics. Include screenshots of the error, what is causing the error (the source), and the expected behaviour. It’d be handy if you could include a repro place file.

I can’t give you specifics of why it’s occurring, but if you follow the above it should eventually be solved, or the behaviour will be explained if it’s intended.

2 Likes

Could you please provide the code, we’ve asked about 3 times each, your answers are very short and simple, providing detailed ones will be helpful, and we can actually help you fix this error.

1 Like

I just wanna know if anyone has had these ‘attempt to call userdata value’, i can show atleast one of them

https://pastebin.com/raw/jPryHAh1

It used to work on StarterPlayerScripts, after the update it doesnt anymore :wave:

wait i get what you mean hold on

1 Like

I cleaned up your code, I will be working on a fix by the time;

local player = {}
local input = {}
local animation = {}

local players = game ("GetService", "Players")
local runservice = game ("GetService", "RunService")
local userinput = game ("GetService", "UserInputService")


do -- player
  local players = game ("GetService", "Players")
  local PLAYER = players.LocalPlayer

  player = setmetatable({}, {__index = function(k)
  return rawget(player, k) or PLAYER:FindFirstChild(tostring(k))
  end})

  local function onCharacter(character)
    wait()
    player.character = character
    player.mouse = PLAYER:GetMouse()
    player.backpack = PLAYER:WaitForChild "Backpack"
    player.humanoid = player.character:WaitForChild "Humanoid"
    player.torso = player.character:WaitForChild "Torso"
    player.alive = true

    repeat wait() until player.humanoid.Parent == player.character and player.character:IsDescendantOf(game)
      animation.crouch = player.humanoid:LoadAnimation(script:WaitForChild"crouch")
      input.stance = "stand"
      local onDied onDied = player.humanoid.Died:connect(function()
      player.alive = false
      onDied:disconnect()
      if animation.crouch then
        animation.crouch:Stop(.2)
      end
      end)
    end
    if PLAYER.Character then
      onCharacter(PLAYER.Character)
    end
    PLAYER.CharacterAdded:connect(onCharacter)
  end

  do -- input
    input.stance = "stand"
    local sprinting = false
    local default_right = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
    local default_left = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
    runservice.RenderStepped:connect(function()
    if animation.crouch then
      if animation.crouch.IsPlaying then
        animation.crouch:AdjustSpeed(Vector3.new(player.torso.Velocity.x, 0, player.torso.Velocity.z).magnitude/10)
      end
    end
    end)
    userinput.TextBoxFocused:connect(function()
    if sprinting then
      sprinting = false
      player.humanoid.WalkSpeed = 16
    end
    end)
    userinput.InputBegan:connect(function(object, g)
    if not g then
      if object.UserInputType == Enum.UserInputType.Keyboard then
        local key = object.KeyCode
        if key == Enum.KeyCode.LeftControl then
          if input.stance == "crouch" then
            player.humanoid.HipHeight = 0
            player.humanoid.WalkSpeed = 16
            player.humanoid.JumpPower = 50
            animation.crouch:Stop(.2)
            input.stance = "stand"
          else
            input.stance = "crouch"
            player.humanoid.HipHeight = -1.7
            player.humanoid.WalkSpeed = 16 * 0.5
            player.humanoid.JumpPower = 30
            animation.crouch:Play(.2)
          end
        elseif key == Enum.KeyCode.LeftShift then
          if not sprinting then
            sprinting = true
            player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.8 or 1.5)
          end
        end
      end
    end
    end)
    userinput.InputEnded:connect(function(object, g)
    if not g then
      if object.UserInputType == Enum.UserInputType.Keyboard then
        local key = object.KeyCode
        if key == Enum.KeyCode.LeftShift then
          if sprinting then
            sprinting = false
            player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.5 or 1)
          end
        end
      end
    end
    end)
  end
1 Like

One second, i realized on output that theres an error on Line 5. It’s apparently what’s causing this userdata value calls?
image

1 Like

game ("GetService", "Players")

This is no longer supported. Make sure to use the GetService method correctly.

2 Likes

attempt to call a userdata value just means that you’re trying to call something that isn’t a function, so check through your code for example:

local thing=0
thing() --this would error because thing is not a function

This line of your code is malformed. It thinks you’re trying to call “game” which is not a function:

local runservice = game ("GetService", "RunService")

and should be:

local runservice=game:GetService("RunService") --calls GetService instead

I don’t see how it would have anything to do with the new VM. (see @byc14’s reply) In the future, please be ready and willing to provide code or else we can’t help you.

5 Likes

Hoh well that’s very new to me, id like to see the new method of it. Thanks for the replies

1 Like

I’d recommend changing every part that has game (“GetService”,service) to
game:GetService(service)

1 Like

game("GetService", "Service") was unintentional behaviour which the new VM no longer supports.