Hello,
I’m trying to make a projectile with a custom character, but it doesn’t seem to work and I know it works with a default character. So what do I need to change for it to work?
Script:
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local Event = script:WaitForChild("RemoteEvent")
local Debounce = false
Mouse.Button1Down:Connect(function()
if not Debounce then
Debounce = true
Event:FireServer(Player)
wait(1)
Debounce = false
end
end)
Since you’re saying the event doesn’t fire, the debounce is most likely your issue here.
local Debounce = false
if Debounce then return end
Debounce = true
Event:FireServer(Player)
wait(1)
Debounce = false
Edit –
You don’t need to send the player instance by the way (from the client in your FireServer() function), since the first parameter of OnServerEvent will be the player instance that fired the RemoteEvent.
Wait I’m just wondering should I put it in Starter Player or Starter Character I placed it in starter player before I think it’s starter character, right?
After testing, I realized it only works in starter character, so thank you for helping I know it’s kind of let down since it’s not really the coding part, so sorry for wasting your time.