Hello everyone, I have problem with probably game pass service or just with Clone(). When player will buy game pass should get items from ReplicatedStorage.PassItems, but i don't know why don't work ;/ If someone can solve it.
Here is script:
pcall(function() game.Players.PlayerAdded:connect(function(player) if game.GamePassService:PlayerHasPass(player,298834435) then local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name) cashmoney.Value = cashmoney.Value + 5000 player.CharacterAdded:connect(function(char) if char:WaitForChild("Humanoid") then char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 25 char.Humanoid.Health = char.Humanoid.Health + 25 char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 8 game.ReplicatedStorage.PassItems.SpeedPotion:Clone().Parent = player.Backpack end end) local msg = Instance.new("Hint",workspace) msg.Text = player.Name.." joined the game with Ultra V.I.P." wait(2) msg:Destroy() elseif game.GamePassService:PlayerHasPass(player,298833834) then local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name) cashmoney.Value = cashmoney.Value + 200 local msg = Instance.new("Hint",workspace) msg.Text = player.Name.." joined the game as a V.I.P." wait(2) msg:Destroy() elseif game.GamePassService:PlayerHasPass(player,303658886) then player.CharacterAdded:connect(function(char) if char:WaitForChild("Humanoid") then game.ReplicatedStorage.PassItems.Boombox:Clone().Parent = player.Backpack end end) end end) end)
In Line 11 you put :Clone().Paren = player.Backpack
instead of :Clone().Parent = player.Backpack
.
try setting line 03
to:
game:GetService("MarketplaceService"):PlayerOwnsAsset(player,id)
change the id
to the id(too lazy to look at the script)
also, i would recommend not using Lighting and switching to a different storage
tell me if this works