Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script I found from a old random game, help fixing it? [closed]

Asked by 5 years ago

I found this script on this random area 51 game, that was abandoned. basically it's supposed to save the player's weapons, give them weapons from a npc that they can talk to which will sell them for a certain price and make sure to not give copies of each weapon.

here's the script, I wanna try to make it able to work on filtering enabled.

------------KeepWeapons on death script--------- --makes you keep any weapons you pick up after you die- --and respawn.

--simply put the script in the map and it will work.

local wm = Instance.new("Model") wm.Name = "Weaps"

function give(weap, player) --add a weap to a player's weaps --return if they allready have a copy for _, w in ipairs(player.Weaps:GetChildren()) do if w.Name == weap.Name then return end end --return if the weaps is a startpack one for _, w in ipairs(game.StarterPack:GetChildren()) do if w.Name == weap.Name then return end end --add it to thier weaps weap:clone().Parent = player.Weaps end

game.Players.PlayerAdded:connect(function(p) wm:clone().Parent = p wait() p.Character.PlayerAdded:connect(function(wep) if wep.className == "Tool" then give(wep, p) end end) p.Changed:connect(function(pr) if pr == "Character" then for _, w in ipairs(p.Weaps:GetChildren()) do w:clone().Parent = p.Backpack end p.Character.ChildAdded:connect(function(wep) if wep.className == "Tool" then give(wep, p) end end) end end) p.Backpack.ChildAdded:connect(function(h) if h.className == "HopperBin" then give(h, p)
end end) end)

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

This is not a request website, so noone will write a full script for you. It's about asking for help so I can only help you with giving you some resources to learn how to convert your scripts to be FE compatible.

here

and here

Ad