Need help fixing a script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I got a model from a tutorial on how to make a script that kicks you out of the vehicleseat if you don’t own a gamepass, but I get a error that shows this:

  2. What is the issue? Include screenshots / videos if possible!



    Screenshot (4)

  3. What solutions have you tried so far? I have tried to fix it, but it didn’t work.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

 local GPID = script.Parent.Configuration.Gamepass.Value
local GPS = game:GetService("MarketplaceService")
local gui= script.NOPASS
script.Parent.ChildAdded:connect(function(child)
    if child.Name == "SeatWeld" then
        local Player = game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent)
        if GPS:UserOwnsGamePassAsync(Player.userId, GPID) then
           else
            child:Destroy()
            child.Part1.Parent.Humanoid.Jump = true
			Player.Character.Humanoid.Jump=true
            local a= gui:Clone()
            a.Parent=Player.PlayerGui
            a.Enabled=true
			wait()
			Player.Character.Humanoid.Jump=true
        end
    end
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I am no expert in scripting by the way.

2 Likes

It appears as if “Configuration” is under the script itself rather than the parent. Have you tried replacing local GPID = script.Parent.Configuration.Gamepass.Value
for
local GPID = script.Configuration.Gamepass.Value?

1 Like