Hey, I’m trying to make it so that if the player has premium, they get a certain tool. It works, but the only problem is that the tools keep duplicating every death, and you end up with so many coils. I’m trying to make it so that they only get 1 coil, and they keep that coil even after death. They keep works, but the duplicating is a problem. Here are the scripts:
Local Script in StarterGui:
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local remoteEvent = ReplicatedStorage:WaitForChild(“PremCoil”)
if player.MembershipType == Enum.MembershipType.Premium then
print("Player Has Premium")
remoteEvent:FireServer()
elseif
player.MembershipType == Enum.MembershipType.None then
print("Player Does Not Have Premium")
end
Script in ServerScriptService:
local Players = game:GetService(“Players”)
game.ReplicatedStorage.PremCoil.OnServerEvent:Connect(function(player)
game.ServerStorage.PremCoil:Clone().Parent = player:WaitForChild(“Backpack”)
game.ServerStorage.PremCoil:Clone().Parent = player:WaitForChild(“StarterGear”)
print(“Coil Was Successfully Given”)
end)