Hello! so I’ve been trying to make it so *** only I*** can give people a flamethrower gear I made, it wont work. Here’s how it supposed to work, I type `/e " Player or Random " " Tool " that’s in replicated storage is supposed to go to their inventory when I do enter. It didn’t work though and this is what cam in the output,
10:47:32.100 ServerScriptService.ToolPasserScript:3: attempt to call a RBXScriptSignal value - Server - ToolPasserScript:3
10:47:32.100 Stack Begin - Studio
10:47:32.100 Script 'ServerScriptService.ToolPasserScript', Line 3 - Studio - ToolPasserScript:3
10:47:32.100 Stack End - Studio
Here’s the script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded(function(player)
player.Chatted:Connect(function(text)
if userId = 1900786800
local text = string.lower(text)
local Tool
for i,v in pairs(ReplicatedStorage.Tools:GetChildren()) do
local ToolName = string.lower(v.Name)
if string.find(text, ToolName) then
Tool = v.Name
end
end
local Receiver
for i,player in pairs(game.Players:GetPlayers()) do
local playerName = string.lower(player.Name)
if string.find(text, playerName) then
Receiver = player
end
end
if Tool and Receiver then
local Backpack = Receiver.Backpack
local newTool = ReplicatedStorage.Tools:FindFirstChild(Tool) :Clone()
end
end)
end)
This came inside the output when I changed it so someone with a userId " my user Id " can only do it
10:54:21.747 ServerScriptService.ToolPasserScript:5: Expected 'then' when parsing if statement, got '=' - Studio - ToolPasserScript:5
Try this.
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
game.Players.PlayerAdded(function(player)
player.Chatted:Connect(function(text)
local text = string.lower(text)
local Tool
for i,v in pairs(ReplicatedStorage.Tools:GetChildren()) do
local ToolName = string.lower(v.Name)
if string.find(text, ToolName) then
Tool = v.Name
end
end
local Receiver
for i,player in pairs(game.Players:GetPlayers()) do
local playerName = string.lower(player.Name)
if string.find(text, playerName) then
Receiver = player
end
end
if Tool and Receiver then
local Backpack = Receiver.Backpack
local newTool = ReplicatedStorage.Tools:FindFirstChild(Tool):Clone()
newTool.Parent = Backpack
end
end)
end)
11:53:01.694 ServerScriptService.ToolPasserScript:30: Expected 'end' (to close 'function' at line 2), got <eof>; did you forget to close 'then' at line 25? - Studio - ToolPasserScript:30
11:53:06.677 ▶ Unable to load plugin icon. (x2) - Studio
local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(text)
if player.UserId == 1900786800 then
local lowertext = string.lower(text)
local Tool,Receiver
for i,v in pairs(ReplicatedStorage.Tools:GetChildren()) do
local ToolName = string.lower(v.Name)
if string.find(lowertext, ToolName) then
Tool = v.Name
end
end
for i,player in pairs(game.Players:GetPlayers()) do
local playerName = string.lower(player.Name)
if string.find(lowertext, playerName) then
Receiver = player
end
end
if Tool and Receiver then
local Backpack = Receiver.Backpack
ReplicatedStorage.Tools:FindFirstChild(Tool):Clone().Parent = Backpack
end
end
end)
end)