#So i wanted to make a script that when u buy a gamepass a script called LockMovement gets disabled.
72 messages · Page 1 of 1 (latest)
in the second if you're checking if lockmovement is enabled
and a syntax error
Enabled-true
so check that
Nope
look
first to enabled you need to do
Enabled = true
and you're doing Enabled-false
and second, the elseif game.Starterplayer...
you need to do only else
because else is what happens if the player doesn't own the gamepass
yes that may work but i would like to make it prettier
something like:
** You are now Level 3! **
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
print("Line 4 works")
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId,1763216298) then --1763216298 is the gamepass id
game.StarterPlayer.StarterCharacterScripts.LockMovement.Enabled = false
print("successfully deleted movement script YAY :D")
else
game.StarterPlayer.StarterCharacterScripts.LockMovement.Enabled = true
end
end)
Yeah no problem we all start from something
local YourCode = 2
this `
what doesnt work
prints something?
of course nothing gonna happen
thats a event that fires when a player joins
to do something when someone buys u should do like this :
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
print("Line 4 works")
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, 1763216298) then --1763216298 is the gamepass id
game.StarterPlayer.StarterCharacterScripts.LockMovement.Enabled = false
print("successfully deleted movement script YAY :D")
else
game.StarterPlayer.StarterCharacterScripts.LockMovement.Enabled = true
end
end)
MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(Player, GamePassId, WasPurchased)
if WasPurchased and GamePassId == 1763216298 then
game.StarterPlayer.StarterCharacterScripts.LockMovement.Enabled = false
end
end)
Try this
this is a event that fires when ANY gamepass prompt is finished
and sends three arguments, the player, the gamepassid of the gamepass prompted and if it waspurchased or not
np we are here for help
1 - Put a print
2 - What are you disabling
the shift lock?
ah i know whats happening
starterplayer replicates all into the player, it isnt a folder inside of the player
theres no thing called lockmovement where do u look at that
or idk where is it
is lockmovement a script that you have?
im too busy so just from here
so tell me, in your startercharacterscripts you have your own script called lockmovement?
is not that
then u just do like this
nah np
of what?
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player: Player)
print("Line 4 works")
local Char = Player.Character or Player.CharacterAdded:Wait()
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, 1763216298) then --1763216298 is the gamepass id
Char:WaitForChild("LockMovement").Enabled = false
print("successfully deleted movement script YAY :D")
else
Char:WaitForChild("LockMovement").Enabled = true
end
end)
MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(Player: Player, GamePassId, WasPurchased)
if WasPurchased and GamePassId == 1763216298 then
local Char = Player.Character or Player.CharacterAdded:Wait()
Char:WaitForChild("LockMovement").Enabled = false
end
end)
would u test that
yes it would work
just make sure of all and
see the output
just debug
lol
alr
what it prints
put prints and all that
there is in your character a script called "LockMovement"?
is it a serverscript?
u need to make sure it is all of that

dw
just dont give up that easy
yeah and more would be
but thats no reason for leaving this
** You are now Level 4! **