Passed value is not a function error

You can write your topic however you want, but you need to answer these questions:

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried to look for it on developer hub. but I couldn’t find any.

i would really appreciate it if you could help me with that.

I want to make an script where if you say /e ui. you become ultra instinct. and i use it as require script.

But the error shows up and it said “Attempt to connect failed: Passed value is not a function

SS Executor - Roblox Studio 1_25_2021 1_49_32 PM (2)

and here is my script.

print("IceyTamim's UI Script Loaded. Say /e ui to become ultra instinct! Its for IceyTamim Only!")

local allowed = {"IceyTamim"}


game.Players.PlayerAdded:Connect(function(player)
for i, v in pairs(allowed) do
	if player.Name == v then 
	         player.Chatted:Connect(function(msg)
			if string.sub(msg, 0,1) == "/" then
				if string.sub(msg, 2) == "e ui" then
					require(6297170890).load(player.Name)
				end
			end
		end)
	end
end
end)
game.Players.PlayerAdded:Connect()

Disclaimer: Remember. If you say that I need to search for these topic or there is already topic of it. It wont work because i tried it out and it didn’t work. So how about you help me with it? Thanks.

:grin:

1 Like

You have a :Connect() on the last line that isn’t doing anything.

1 Like

I am confused. Can you please be more specific? When i remove it. it still happens. or am i doing something wrong?

print("IceyTamim's UI Script Loaded. Say /e ui to become ultra instinct! Its for IceyTamim Only!")


local allowed = {"IceyTamim"}


game.Players.PlayerAdded:Connect(function(player)
	if table.find(allowed, player.Name) ~= nil then
		player.Chatted:Connect(function(msg)
			if string.sub(msg, 0,1) == "/" then
				if string.sub(msg, 2) == "e ui" then
					require(6297170890).load(player.Name)
				end
			end
		end)
	end
end)
1 Like

Delete the last line of your code:

game.Players.PlayerAdded:Connect()

2 Likes

How didnt he notice that? Literally just noticed right away.

1 Like

Oh thanks. you and kylerzong gave me an good solution. so i will just pretend your post and their post is solution to my topic. lol.

2 Likes