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

I am new to scripting i dont know much so please it says parent is not a valid member of tool what?

where the error is

key1:Clone().parent = player.StarterGear

heres the entire code

local ServerStorage = game:GetService("ServerStorage")
local key = ServerStorage["keycardL2"]
local marketplacescervice = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local gamepassID = 429957

local function onPlayerAdded(player)
	local haspass = marketplacescervice:UserOwnsGamePassAsync(player.UserId, gamepassID)
	
	if haspass then
		print(player, "owns the gamepass with ID", gamepassID)
		local key1 = key:Clone()
		key1.Parent = player:WaitForChild("Backpack")
		key1:Clone().parent = player.StarterGear
		end
	end
	Players.PlayerAdded:Connect (onPlayerAdded)

1 answer

✓ Accepted answer

you forgot to capitalize part it should be key1:Clone().Parent

2 comments

0

oh when i type script.parent it wont make me so im in the habbit of doing it..

0

yup it worked thanks so much

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