Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Local Parts Gamepass Door Not Working?

Asked by
yoshi8080 445 Moderation Voter
9 years ago

It's something I've been wondering, I've tested around with server sided parts, but I'm not quite sure if local parts are able to work with a gamepass. I've tried to make a script which is shown below, which doesn't work. Info: The script Is a local script in StarterGui

MarketplaceService = game:GetService("MarketplaceService")
PassId = 271665163
modelname = "Door"
modelnametwo = "Other Door"

function respawned(char)
local player = game.Players:FindFirstChild(char.Name)
if MarketplaceService:PlayerOwnsAsset(player, PassId) then
local parts = game.ServerStorage[modelname]
parts:Clone().Parent = game.Workspace.CurrentCamera
else
local block = game.ServerStorage[modelnametwo]
block:Clone().Parent = game.Workspace.CurrentCamera
end
end

I've tested this but the parts won't even clone, also the output has no errors. Please have an explanation so I'll be able to understand why this wouldn't work.

0
The script must be local to use local parts. Marios2 360 — 9y
0
It's a local script in startergui yoshi8080 445 — 9y
1
You haven't called the function, and you can also get the player by going 'local p = game.Players.LocalPlayer' TheDeadlyPanther 2460 — 9y
0
Should you have an answer so it can be considered answered? Also thanks for the help. yoshi8080 445 — 9y

Answer this question