Answered by
2 years ago Edited 2 years ago
If Im correct, Its a local script thats causing the problem of your tools not functioning
the reason Is quite simple, whenever you press the Item giver, the local script will give you the Item. Don't be fooled though! as despite giving you the Item, It actually doesn't appear In the server side, you can check by play testing, pressing the button that gives you the tool, equip the tool, and lastly, go to test > then press the button: "Current: Client" (What the "Current: Client" does It that It lets you view both client and server side)
I encounter this before Ill share you how to fix It:
If you don't want to do the steps, use this free model I made:
https://web.roblox.com/library/10957699247/Item-Giver-GUI
- Create a RemoteEvent In ReplicatedStorage
- Add In a local script In a button gui
3.Paste this script:
1 | local button = script.Parent |
2 | local Rep = game.ReplicatedStorage |
4 | button.MouseButton 1 Click:Connect( function () |
5 | Rep.RemoteEvent:FireServer(game.Players.LocalPlayer) |
6 | Rep.RemoteEvent:FireServer( "Thing" ) |
Create a folder which has every Item you have (Folder must be In ReplicatedStorage and Items are In the folder)
Create a script ServerScriptStorage
Type this:
01 | local event = Rep.RemoteEvent |
02 | local descendants = Rep.Weapons:GetDescendants() |
04 | local function giveTools(player, toolsType) |
05 | for index, descendant in pairs (descendants) do |
06 | if toolsType = = "Thing" then |
07 | if descendant.Name = = "Item Here" or descendant.Name = = "Item here" then |
08 | local weaponsToGive = descendant:Clone() |
09 | weaponsToGive.Parent = player.Backpack |
15 | event.OnServerEvent:Connect(giveTools, toolsType) |
The script above me gives you two Items, If you just want one do this:
01 | local event = Rep.RemoteEvent |
02 | local descendants = Rep.Weapons:GetDescendants() |
04 | local function giveTools(player, toolsType) |
05 | for index, descendant in pairs (descendants) do |
06 | if toolsType = = "Thing" then |
07 | if descendant.Name = = "Your already dead car" then |
08 | local weaponsToGive = descendant:Clone() |
09 | weaponsToGive.Parent = player.Backpack |
15 | event.OnServerEvent:Connect(giveTools, toolsType) |
And your done
If the answer doesn't work, Its due to me simply copying all the scripts In a random game I made