This local script fires a RemoteEvent inside the local script in StarterPlayerScripts:
Mouse.Button1Up:Connect(function()
MouseDown = false
shootingCD = true
if Power == 0 then
print("yo")
script.HasShot:FireServer(Power)
wait(2)
shootingCD = false
elseif Power == 1 then
print("yo")
script.HasShot:FireServer(Power)
Power = 0
wait(2)
shootingCD = false
elseif Power == 2 then
print("yo")
script.HasShot:FireServer(Power)
Power = 0
wait(2)
shootingCD = false
elseif Power == 3 then
print("yo")
script.HasShot:FireServer(Power)
Power = 0
wait(2)
shootingCD = false
end
But the script that detects when the RemoteEvent has been activated doesn’t work. Heres that script:
script.Parent.OnServerEvent:Connect(function(Power)
print("Worked")
if Power == 1 then
print("1 Fired")
end
if Power == 2 then
print("2 Fired")
end
if Power == 3 then
print("3 Fired")
end
end)
The spelling is all correct, I’m sure theres something I’m missing to make the script detect the RemoteEvent .
Here is what the explorer looks like:
What I want to achieve is allowing the script to detect when the RemoteEvent is fired.