Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I fix cannot FireServer when trying to fire a Remove Event?

Asked by 3 years ago

I just got introduced to what are Remove events and I tried my own I did everything but I'm still getting this error saying it can't fire this server.

local Invisible = true

local UnInvisible = false

local RE1 = script:WaitForChild("Invisible")

local RE2 = script:WaitForChild("Uninvisible")
game:GetService("UserInputService").InputBegan:connect(function(input, gamepor)
if (input.KeyCode == Enum.KeyCode.Q) and Invisible == true then 
    script.RE1:FireServer() 
    UnInvisible = false
    wait(40)
    script.RE2:FireServer() 
    Invisible = false
    UnInvisible = true
end

end)

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

Are you sure this is a LocalScript? If no, change it to :FireClient(player) instead. Also you need to get the player parameter by accessing game:GetService("Players").PlayerAdded. Since you cannot run the script by not locating anyone and the script will be like: "Who would I send this event to?" and sends back an error. Instead, if you use :FireAllClients() you don't need to put anything in the bracket if you don't have any additional informations for the other script.

If this does not work, you can try putting a print statement inside the line 9. So it make sure it runs through.

Ad

Answer this question