Hi all,
So I have recently made a capture point system for my game, when I test this on my development game it works perfectly with no flaws, however when I copy and paste the system from this game into another it stops working for some reason.
After doing some print debugging I have discovered that my remote event is not being received by the client which is why my UI is not updating.
I do not understand though why this works flawlessly on one game but breaks in another. If anyone is able to help me find the solution to this I would be grateful.
Solutions I have already tried:
-Disabling all other scripts in my game to ensure they are not clashing with my new script
-Using FindFirstChild() and WaitForChild()
-Copying and pasting the raid system again into the game
-Print debugging (see below)
My code:
SERVER
local UpdateUIEvent = Instance.new("RemoteEvent",game.ReplicatedStorage) -- Create UI Remote
UpdateUIEvent.Name = 'RaidUI'
if point.status >= 1 and point.owner ~=1 then -- Captures to friendly
print('capped') -- Prints
point.owner = 1
point.term:FindFirstChild('Sign').Handles.Color3 = FriendlyTeam.TeamColor.Color
point.display.BackgroundColor3 = Color3.fromRGB(40,50,32)
UpdateUIEvent:FireAllClients('Captured', point.term.Parent.Name,FriendlyTeam.Name,1) -- Fire clients when a term is capped
print('client fired') -- Prints
CLIENT
local UIEvent = game.ReplicatedStorage:WaitForChild('RaidUI')
UIEvent.OnClientEvent:Connect(function(action,Terminal,Team,TermStatus)
print('remote recieved') -- Does not print
if action == 'Captured' then
print('cap recieved') -- Does not print
Notify(Team..' have captured terminal '.. Terminal)
for _,v in pairs(BG.Terms:GetChildren())do
if v.Name == Terminal then
if TermStatus == 1 then v.BackgroundColor3 = FriCol
elseif TermStatus == -1 then v.BackgroundColor3 = Hoscol end
end
end
Just tried that and it didnt work, I am not getting any yield warnings in the console however
My script now looks like this:
the print is printing though which tells me that it is able to find the event but somehow it is not recieving anything when the server fires it
no, FindFirstChild, second parameter of FindFirstChild is bool was found so no…
well, why are you anyways creating a remote event @topdog_alpha , this is bad practice if you’re not returning to client properly
I was creating the event in a script for sake of simplicity as I want to install this system into multiple games.
I have tried creating the event manually and putting it in ReplicatedStorage instead of creating it in my script but this has had no effect and the script still does not work.
What I still do not understand though is why this works perfectly in another game but when I copied it into my new game it breaks, this is the second time I have had this issue
Just gave that a go, no effect. The conclusion I have arrived at from this is pretty much that the client is not detecting any remote events being sent to it
Is the LocalScript in the exact same position as it was in the game that worked? If not, try moving it to the same position in the explorer, such as StarterCharacterScripts. If it is then try it anyway.