The error that I have notice is that when I press Q nothing happens and there is no error/output at all in the Output tab.
local uis = game:GetService(“UserInputService”)
local tool = script.Parent
local serverStorage = game:GetService(“ServerStorage”)
local beam = serverStorage.characterItemsAndAttacks.adminSans.blasters.beam
db = false
local firing = function()
if db==false then
print(“start”)
db=true
local beamClone=beam:Clone()
beamClone.Parent=script.Parent.Parent.Character.RightArm
beamClone.CFrame=script.Parent.Parent.Character.RightArm.CFrame*CFrame.new(1000,0,0)
beamClone.Size=Vector3.new(2000,100,100)
wait(1)
beamClone:Destroy()
db=false
print(“end”)
end
end
tool.Equipped:Connect(function()
uis.InputBegan:Connect(function(input, gpe)
if input.UserInputType==Enum.UserInputType.Keyboard then
if input.KeyCode==Enum.KeyCode.Q then
firing()
print(“success!”)
end
end
end)
end)
Read over the script again. This won’t work. Parts don’t replicate to the server via localscripts and UserInputService won’t work with normal scripts. To make this work you would need to split the UserInputService and the rest of the code into a localscript and a script bridged by a RemoteEvent. I can try and write the script out for you later if you need.
thank you guys for the help, sorry i didnt reply right away, this goes for everyone. ill look into it and come back when i have redone the script. this is a server script btw
i know this is dead, but i figured if someone decides to read this looking for help, id answer my own question. first, is something most people pointed out, there needs to be both a local and server script, replicating between one another. second, and another fair argument made before, is that the script was formatted poorly when i sent it, on top of that, the tool.Equipped event is being used completely wrong lol. ill rewrite this in a moment, and post the fixed code.