#Any scripter can help me with my loot player system? I have a small problem and Idk how to fix it

1 messages · Page 1 of 1 (latest)

zenith spruce
#

Any scripter can help me with my loot player system? I have a small problem and Idk how to fix it

long ingot
zenith spruce
#

Alright thank you

#

I have a problem when I try to loot a player it shows in the GUI No Items even if the player has tools with him

Server Script:

#

-- LootSystem_Client.lua

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")

local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")

local LootRemote = ReplicatedStorage:WaitForChild("LootRemote")
local ErrorRemote = ReplicatedStorage:WaitForChild("ErrorRemote")

local LOOT_GAMEPASS_ID = 1605064956

local LootGUI = PlayerGui:WaitForChild("Looting")
local ErrorGUI = PlayerGui:WaitForChild("ErrorLootMessage")

local main = LootGUI:WaitForChild("Main")
local invFrame = main:WaitForChild("InvFrame")
local template = invFrame:WaitForChild("Item")
local closeBtn = main:WaitForChild("CloseButton")

floral kiteBOT
#

studio** You are now Level 1! **studio

zenith spruce
#

closeBtn.MouseButton1Click:Connect(function()
LootGUI.Enabled = false
end)

local function showError(msg, prompt)
local frame = ErrorGUI:WaitForChild("ErrorFrame")
local label = frame:WaitForChild("Message")

ErrorGUI.Enabled = true
label.Text = msg

if prompt then
    MarketplaceService:PromptGamePassPurchase(player, LOOT_GAMEPASS_ID)
end

task.wait(3)
ErrorGUI.Enabled = false

end

ErrorRemote.OnClientEvent:Connect(showError)

LootRemote.OnClientEvent:Connect(function(ownerId, items)
for _, child in ipairs(invFrame:GetChildren()) do
if child ~= template then
child:Destroy()
end
end

if #items == 0 then
    local empty = template:Clone()
    empty.Text = "No items"
    empty.Visible = true
    empty.Parent = invFrame
    LootGUI.Enabled = true
    return
end

for _, itemName in ipairs(items) do
    local btn = template:Clone()
    btn.Text = itemName
    btn.Visible = true
    btn.Parent = invFrame

    btn.MouseButton1Click:Connect(function()
        LootRemote:FireServer("TakeItem", ownerId, itemName)
    end)
end

LootGUI.Enabled = true

end)

-- Hook proximity prompts
local function hook(prompt)
if prompt:IsA("ProximityPrompt") and prompt.Name == "StealPrompt" then
prompt.Triggered:Connect(function()
local bag = prompt.Parent
if bag then
local ownerId = bag:GetAttribute("OwnerUserId")
if ownerId then
LootRemote:FireServer(ownerId)
end
end
end)
end
end

for _, obj in ipairs(workspace:GetDescendants()) do
hook(obj)
end

workspace.DescendantAdded:Connect(hook)

#

Local script:

#

@long ingot I can send you a file if you want.

zenith spruce
# long ingot this feels ai generated

Yeah I made it with chatgpt because I tried to script it myself and it did not work I gave it some of the script that I scripted myself and the idea for it

long ingot
zenith spruce
#

And the Baggy union

long ingot
zenith spruce
#

Alright i will send you everything

long ingot
#

and maybe explain like how your game works or send video footage of it

zenith spruce
#

I can pay if you fix it

long ingot
zenith spruce
#

Alright thanks man

zenith spruce
#

I sent it

zenith spruce
long ingot
zenith spruce
#

Bet

long ingot
#

Btw just to be sure. You did write the local script yourself right?

#

And btw can you send footage of how your game play looks

zenith spruce
#

Alright?

long ingot
#

Is there not a way you could record your screen ?

zenith spruce
#

Added me back

zenith spruce
floral kiteBOT
#

studio** You are now Level 2! **studio