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

I play in roblox studio, it plays good but when I play it in the website of roblox it dont work?

Asked by 2 years ago
Edited 2 years ago

for i, v in pairs(script.Parent:GetChildren()) do if v:IsA("TextButton") or v:IsA("ImageButton") then -- Makes sure it is a button if v:FindFirstChild("Id") then -- Makes sure that there is 'Id' inside text label if v.Id.Value > 0 then -- Makes sure there is an id in 'Id' v.MouseButton1Click:Connect(function() game.MarketplaceService:PromptGamePassPurchase(game.Players.LocalPlayer, v.Id.Value) -- Prompts the player to purchase the gamepass end) end end end end

repeat wait() until game.Players.LocalPlayer.Character -- Yields until our character is loaded

while wait() do local magnitude = (game.Players.LocalPlayer.Character.PrimaryPart.Position - game.Workspace.Shop.Hitbox.Position).Magnitude if magnitude <= 11.5 then -- Max magnitude script.Parent.Visible = true else script.Parent.Visible = false end end

And in the dev console it says

Players.ELPEQUENOIKER.PlayerGui.Main.MainFrame.GemsShop.LocalScript:16:attempt to index nil with "Position" Stack Begin Script "Players.ELPEQUENOIKER.PlayerGui.Main.MainFrame.GemsShop.LocalScript", Line 16

0
can you put ur code in a code block?? theking66hayday 841 — 2y
0
dear god please put it in code ChromeDarkMode 15 — 2y
0
oh dear it's really fricking hard to read Doraemon4680 0 — 2y

Answer this question