hello! im trying to get more familiar w module scripts but it keeps throwing me this error. ty
module:
local distancekillModule = {}
function distancekillModule.playerAdded(plr:Player)
local plrs:Players = game:GetService("Players")
plrs:Chat("heello!")
end
game.Players.PlayerAdded:Connect(distancekillModule.playerAdded)
return distancekillModule
script:
local module = require(script.distancekillModule)
module.playerAdded()
Your script is fine, its just that Players:Chat() doesn’t work because, Players is the storage of all the player instances and calling Chat doesn’t make sense, since your basically telling the player storage to chat?
hello! ty 4 ur reply. yes thats very valuable information. what im trying to do is when a player joins, i want them to say something if that makes sense. i tried Chat:chat(Character.Head, "hello") something like that but i cant get it to work tbh
i tried putting in the displaybubble feature but its not displaying tbh. thought i had to put a wait but nope.
function distancekillModule.playerAdded3()
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(char)
wait(2)
if plr.UserId == 64032380 or plr.Name == "targetframed" then
print("check complete, "..plr.Name.. " has joined the server")
local tcs:TextChatService = game:GetService("TextChatService")
tcs:DisplayBubble(char.Head, "hello lol")
end
end)
end)
end