Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why my leaderboard doesn't working on Filtering Enabled?

My code is working on not Filtering Enabled but on FE it doesnt working i need help!

local Humanoid = script.Parent.Enemy

function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
	if tag ~= nil then 
		if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
			if Leaderstats ~= nil then 
Leaderstats.Kills.Value = Leaderstats.Kills.Value +1
wait(0.1)
script:remove()
			end 
		end 
	end 
end 
Humanoid.Died:connect(PwntX_X) 

2 comments

0

What's the type of script (Server script, Local script, or Module script.)? And where is the script located?

1

You're trying to edit a leaderboard that's clientsided with a script on the server. Filteringenabled cuts off client/server interactions. Try doing some gymnastics and using remotes.

1 answer

First of all: :remove() is deprecated, it doesn't work, use :Destroy() instead; :connect() is deprecated too, use :Connect() instead; :findFirstChild() is ALSO deprecated, use :FindFirstChild() instead.

You might want to use this:

local Humanoid = script.Parent.Enemy

function PwntX_X() 
	local tag = Humanoid:FindFirstChild("creator")
	if tag and tag.Value then 
		local Leaderstats = tag.Value:FindFirstChild("leaderstats") 
		if Leaderstats then
			-- You might want to use Remote Events in this one.
			Leaderstats.Kills.Value = Leaderstats.Kills.Value + 1
			script:Destroy()
		end
	end 
end

Humanoid.Died:Connect(PwntX_X) 

Hope this helped! Tell me if it doesn't work.

1 comment

0

it doesnt working. i need fire the remote event but i dont know in ReplicatedStorage i have Awarder ("RemoteEvent") Can you script?, Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.