- I want to achieve something like this, where when a user presses a button on their keyboard, a “Defender” will pop up and fight for them. I just need the action part of when the user presses a button and will float at their side for a couple of seconds | Link: https://images-ext-1.discordapp.net/external/76bw_uQKEdiSHX_LcWVPRXeaj7zxR9VhzTUHdtg6VSU/https/i.gyazo.com/7b040fea4630d97e23df0b4e6b861f72.mp4
I have some of the script done, but I’m just stuck on where to go next:
`local StandID = 4464987098 --Find ID of Stand once made (Done)
local Equip = game.Workspace
function add()
--Function to get the Stand
local data = game:GetService("InsertService"):LoadItem(StandID)
local instance = data:GetChildren()
if #instance == 0 then
data:Remove()
return
end
–extra--------------------------------------------------------------
local summon = game.Players.LocalPlayer.Character:FindFirstChild(“Torso”)
game.workspace:GetService("InsertService"):Insert(data)
data:MoveTo(summon.Position + summon.CFrame.lookVector * 3)
data.Name = ("InsertedItem").. StandID
Equip.Handle.Drop:Play()
end
ableis = true
function PressKeyboardQ (PC)
if not ableis then
return
end
ableis = false
add()
wait(1)
Equip:Remove()
end
function PressKeyboardQ (PC)
if PC == nil then
print(“Pressing Q not avaible”)
return
end
PC.Image = "https://www.roblox.com/library/4464987098/Blackhole"
PC.Button1Down:connect(function() PressKeyboardQ(PC) end)
end
Equip.Equipped:connect(PressKeyboardQ)`
I’ve tried to look up some tutorials, but no dice.
I’ve tried to add and add on to this script, but nothing is working. I might be able to look at some more tutorials.
Are you able to help/give suggestions?