script.Parent.ClickPart.ClickDetector.MouseClick:Connect(function()
script.Parent.Parent = game.ServerStorage.PlayerINV
if game.ServerStorage.PlayerINV:WaitForChild("SparkPlug") then
game.PlayerGui.Pickup.BG.Visible = true
end
end)
COMMUNITY QUESTION
PlayerGui is not a valid member of DataModel?
1 answer
Hello.
PlayerGui is not a service, but a child of a player. In this case, you can get the player from the parameter of MouseClick, and then just indexing PlayerGui.
Here's your fixed script:
script.Parent.ClickPart.ClickDetector.MouseClick:Connect(function(player)
script.Parent.Parent = game.ServerStorage.PlayerINV
if game.ServerStorage.PlayerINV:WaitForChild("SparkPlug") then
player.PlayerGui.Pickup.BG.Visible = true
end
end)
I hope this helps. Cheers!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
What did i DO wrong?