Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

my gamepass script will not work i go to the prison but dont ever get out?

local gamepassid = 6429682

local GamepassServis = game:GetService("GamePassService")

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,Playertoatt, playerstoattsname)

print(game.Players[playerstoattsname].Name)

Playertoatt.CFrame = game.Workspace.PrisonTp.CFrame+Vector3.new(0,1,0)

if GamepassServis:PlayerOwnsGamePassAsync(game.Players[playerstoattsname], gamepassid) then

wait(5)

Playertoatt.CFrame = game.Workspace.OutOfPrisonTp.CFrame+Vector3.new(0,1,0)

else

wait(60)

Playertoatt.CFrame = game.Workspace.OutOfPrisonTp.CFrame+Vector3.new(0,1,0)

end

end)
this also wont work.

3 comments

0

local mouse = game.Players.LocalPlayer:GetMouse() script.Parent.Activated:Connect(function() if mouse.Target.Parent.Humanoid ~= nil then local mag = (game.Players.LocalPlayer.Character.HumanoidRootPart.Position-mouse.Target.Parent.HumanoidRootPart.Position).magnitude print(mag) if mag <= 5 then script.Parent.RemoteEvent:FireServer(mouse.Target.Parent.HumanoidRootPart, mouse.Target.Parent.

0

this is the local script with the real script

0

u got the wrong game:GetService

1 answer

Use UserOwnsGamePassAsync and you need to Change the Service to GamepassService!

1 comment

0

local gamepassid = 6429682 local GamepassServis = game:GetService("GamePassService") script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,Playertoatt, playerstoattsname) print(game.Players[playerstoattsname].Name) Playertoatt.CFrame = game.Workspace.PrisonTp.CFrame+Vector3.new(0,1,0) if GamepassServis:PlayerOwnsGamePassAsync(game.Players[playerstoattsname], gamepa

This discussion is preserved as it was. New answers, comments, and votes are closed.