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

Why doesn't the script give the gear?

Asked by
yoshi8080 445 Moderation Voter
8 years ago

I wanted the player to a door to get it. I don't need a script that already does it, but I want it manually.

-- Just a note for people who don't know, this "isn't the whole script"
local player = Players:GetPlayerFromCharacter(hit.Parent)
local human = player:FindFirstChild("Humanoid")
if MarketplaceService:PlayerOwnsAsset(player, GearId) and player.StarterGear:FindFirstChild("TurkeyLeg")~= nil then
InsertService:LoadAsset(GearId):Clone().Parent = player.StarterGear
print("Player Has")
else
human.Health = 0

All variables are defined, but I need to figure why it won't give the player the gear if the player doesn't have it? The human.Health = 0 is just a placeholder, since It'll be replaced with something else later.

0
Humanoid is not a member of player but the player.Character. BobserLuck 367 — 8y
0
It's 'game:GetService("InsertService")'. You need an end at the bottom of the script. TheDeadlyPanther 2460 — 8y
0
I just said it's a part of the script, rip yoshi8080 445 — 8y

Answer this question