Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

not a valid member of Workspace error and I dont know how to solve it

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!
Status
Not open for further replies.

Quincitizens

Member
Reputation: 0 / 0 / 0
Oct 22, 2019
32
3
8
Roblox
Quincitizens
I get
CurrentCheckPoint is not a valid member of Workspace "Workspace" - Server - SkipStagePurchaseHandler:16


The script is :
Lua:
local mps = game:GetService("MarketplaceService")

local devProductID = 1162879127

mps.ProcessReceipt = function(purchaseInfo)

    local plrPurchased = game.Players:GetPlayerByUserId(purchaseInfo.PlayerId)

    if not plrPurchased then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end

if purchaseInfo.ProductId == devProductID then


        local currentCheckpoint = string.split(game.Workspace.CurrentCheckPoint.Name, "Checkpoint:")
        local nextCheckpoint = currentCheckpoint[1]..currentCheckpoint[2] + 1

        plrPurchased.Character.HumanoidRootPart.CFrame = game.Workspace:FindFirstChild(nextCheckpoint).CFrame

        plrPurchased.Team = game.Teams.UrTeam
       
        end

        plrPurchased:LoadCharacter()

        return Enum.ProductPurchaseDecision.PurchaseGranted
end

I have my checkpoints in my workspace as "Checkpoint:1" , "Checkpoint:2" and I don't know what the problem is
 

ElHomburgerGuy

If you won't let yourself fail, you won't improve
Reputation: 5 / 0 / 1
Apr 24, 2019
6,640
20
2,586
113
Anonymous in the USA
Roblox
PieroWasTaking
You don't have anything in your workspace called CurrentCheckPoint that's what the script is complaining about so instead tried to define Checkpoint1 or Checkpoint2 and see what happens from there.
 
Status
Not open for further replies.