#Event not firing to client from server on cloned script
1 messages · Page 1 of 1 (latest)
@vagrant hound add in some prints, to make sure check attack is getting fired, and Target exists
i did
the prints get all the way to the event fire
i have a print on the event recieve and i get nothing
@lone swan
try firing the client without any arguments (ik your script wont work as intended but i hope you can see why im saying this)
alright let me try
without any arguments i get an error
with just a player argument i still get nothing
let me change it to fireallclients and see if it makes a difference
yup, still nothing
getting my target found print but the fire doesnt do anything
let me check
Yes
yes i am
Is the top script server, and the bottom client yeah?
in here in the
animateTowerEvent:FireClient(player, newTower, "Attack", target)
your inputting 3 actual argument and the player is who you are sending it to.
However in here.
the function on the client wants 4 arguments. and since your referencing your player in this then just use the LocalPlayer and remove the player argument in this
wdym bottom client?
we tried removing all arguments and still nothing worked
dont remove all arguments
image 1 is server
image 2 is client
wait sorry
wrong way round
wait no im right
image 1 server
image 2 client
i reverted them
Remove the "player" argument in the client script
and instead create a player variable
local Players = game:GetService("Players")
local player = Players.LocalPlayer
for "FireAllClients" you dont need to specify which player your sending it to
this can be at the top of a local script
im not sure which one would be better to do
should i use FireAllClients or FireClient
depends on the context and what your making and so on
im guessing your making a tower defense game?
or something
Tower Defence Game, and the scripts you were helping me with are inside of one of the towers and will be inside all of them
if you can have multiple players in the same Match then FireAllClients as its more than 1 person
okay i use fireallclients
so hold on
at the told i added the player variable
should i remove the player as a argument for my checkAttack.Event
on the client/local script
i added on server script
the animateTowerEvent is being sent from server
you cant access a "Local" player on server script
so im confused what you want me to do?
you want me to remove the player argument on server side?
in this client script.
** You are now Level 9! **
.
yes
okay okay
1 sec
i did that let me test
im still getting nothing on the the animateTowerEvent receive
heres an updated look at the scripts
is CheckAttack actually firing. or can it just not find a target or "head" of the newtower
because you should at least have "EVENT STARTED" from this one
not sure then if it is finding the target and supposedly firing the event without any errors and the "print" statement isnt printing then im currently not sure
im unsure to, it must not be firing the event, thats the only explanation
where is the animateTowerEvent located
ReplicatedStorage - RemoteEvents
game.ReplicatedStorage.RemoteEvents.animateTowerEvent:FireAllClients(nil, "Attack", nil)
run that in the console
this bar thing
no
animateTowerEvent
then change it in here to the actual name
the variable is animateTowerEvent and the name is "AnimateTower"
game.ReplicatedStorage.RemoteEvents.AnimateTower:FireAllClients(nil, "Attack", nil)
"FireAllClients can only be called from the server"
make sure to be running/playing first and then switch over to server side
the one of the right here
click that
not sure then. Just delete and re-add the remote or something atp then if you didnt even get a print statement out of that line of code ¯_(ツ)_/¯
alright let me try
just to double check, a remote event crosses the server and client boundary?
a remote event can be fired from the
Client -> Server
and
Server -> Client