So I'm working on an FPS game and I wanted the FIRST weapon in backpack equipped as soon as the player hits the "Play" button in the main GUI,unfortunately I do not know how.
Here's my attempt anyways : (LocalScript Inside the "Play" button)
player = game.Players.LocalPlayer function onClick() player.Character.Humanoid:EquipTool(player.Backpack.ToolName) --Asking for specific tool end script.Parent.MouseButton1Down:connect(onClick)
As you see in line "3" I'm asking for a specific tool name, But I want the first Tool in the Backpack to be equipped any solutions/ideas?
Help will be appreciated! :D
Try putting the tool in ReplicatedFirst and leave any scripts in it enabled and you should use the MouseButton1Click event of a text button Random Example:
local Tool = game.ReplicatedFirst.Gun
script.Parent.MouseButton1Click:connect(function() local ToolClone = Tool.Clone() ToolClone.Parent = game:GetService("Players").LocalPlayer.BackPack end)
This was typed as if the script was in the text button or the play button hope this helped a bit!