I have a tool for a Gamepass that is located within replicated storage. But when it is moved from replicated storage to my backpack it dosent work anymore. I really need to fix this quickly
my script that checks if the player owns the pass in located in StarterGui
and the tool is located in replicated storage
local player = game.Players.LocalPlayer
local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,94747658)
if ownsGamepass then
local DualGravityCoil = game:GetService("ReplicatedStorage"):WaitForChild("DualGravityCoil"):Clone()
DualGravityCoil.Parent = player.Backpack
end
Yeah you are right.I made this scripts and he need to create RemotEvent in ReplicatedStorage called ItemMove,First script is local script and next one you need to use in ServerScriptService:
local player = game.Players.LocalPlayer
local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,94747658)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ItemMove = ReplicatedStorage:WaitForChild("ItemMove")
if ownsGamepass then
ItemMove:FireServer()
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ItemMove = ReplicatedStorage:WaitForChild("ItemMove")
local DualGravityCoil = ReplicatedStorage:WaitForChild("DualGravityCoil"):Clone()
ItemMove.OnServerEvent:Connect(function(player)
local Backpack = player:WaitForChild("Backpack")
DualGravityCoil.Parent = Backpack
end)