#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)
Send the script and explain what the problem is
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")
** You are now Level 1! **
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.
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
yeah send it as a file
yeah for the local script
Alright i will send you everything
and maybe explain like how your game works or send video footage of it
I can pay if you fix it
don't expect to much. I'll just TRY to help i don't want payment.
Alright thanks man
Check dms.
I sent it
Did you take it ?
Yeah im lookin through it rn
Bet
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
I can give you permission to join the game. I will add your game pass ID in the script so you can loot and you will see
Alright?
Is there not a way you could record your screen ?
Sure in call
Added me back
Yo hello
** You are now Level 2! **