So, Im trying to make a projectile attack however it isn't working.
so both the scripts are both in a tool with a remote event named Fire
local script:
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Button1Down:Connect(function() script.Parent.Fire:FireServer() print("Fired") end)
normal script:
-->>Variables<<-- local player = game.Players.LocalPlayer local Attack = game.ReplicatedStorage.Attack local Tool = script.Parent -->>Events<<-- script.Parent.Fire:Connect(function(player, argument) Attack:Clone() Attack.Parent = Tool.Parent Attack.Position = script.Parent.Parent.Torso.Position Attack.Velocity = Vector3.new(10, 0, 0) Attack.Orientation = script.Parent.Parent.Torso.Orientation wait(10) Attack:Destroy() end)
If I can get some help figuring this out it would be greatly appreciated im new to scripting, Thanks!
You can put a script inside serverscriptservice, and when the event is fired, you can run the script
game.ReplicatedStorage.RemoteEvents.Event.OnServerEvent:Connect(function() --script end)