faadee
(faadee)
July 3, 2022, 10:08pm
#1
So I have this simple script, I run it and get nothing. Output is empty no errors no warnings nothing.
game.Players.PlayerAdded:connect(function(player)
print("Player Joined")
end)
I don’t know why this script doesn’t work.
I tried publishing the game and it still didn’t work. I don’t know how to fix this problem.
It’s a script inside of a part.
Is this a local script? charlimitssss
faadee
(faadee)
July 3, 2022, 10:09pm
#3
It’s not a local script. It’s a script inside of a part inside the workplace.
NimaDev
(Nima)
July 3, 2022, 10:10pm
#4
Did you make sure that the script isn’t disabled?
faadee
(faadee)
July 3, 2022, 10:11pm
#5
The script isn’t disabled. I also tried to make another script that also didn’t work.
Dfn150
(DevFunNewIdeas)
July 3, 2022, 10:12pm
#6
faadee:
(function(player)
This parameter has no purpose, try removing it and see if that works
game.Players.PlayerAdded:Connect(function()
NimaDev
(Nima)
July 3, 2022, 10:12pm
#7
Could you send some screenshots of where the script is located etc…
It definitely does serve a purpose as it gets the player who just joined. In this specific script, no, but theres no use removing it.
faadee
(faadee)
July 3, 2022, 10:13pm
#9
Tried to remove it, still didn’t work.
Dfn150
(DevFunNewIdeas)
July 3, 2022, 10:18pm
#11
You simply only have to put the script in the workspace and type this
game.Players.PlayerAdded:Connect(function()
if game.Players.PlayerAdded then
print("Player Joined")
end
end)
Add the script In ServerScriptService see if that will work.
Dfn150
(DevFunNewIdeas)
July 3, 2022, 10:18pm
#13
I also have tested this and it does work
NimaDev
(Nima)
July 3, 2022, 10:18pm
#14
Try adding a wait() before printing.
I’m extremely confused on why your script isn’t printing anything because I’ve just tested it and it worked
Are you sure you’re looking in the right part of your output? You have the first dropdown to “All Messages” and second to “All Contexts”
@faadee (accidentally replied to the wrong person)
NimaDev
(Nima)
July 3, 2022, 10:19pm
#16
I don’t think that\s a necessary thing to do, the script should work without that adding the if statement, but in his case I’m kinda confused why it’s not working
Maybe it’s a bug, Maybe he could try rejoining?
Dfn150
(DevFunNewIdeas)
July 3, 2022, 10:20pm
#18
But it does work because I have tested it
faadee
(faadee)
July 3, 2022, 10:21pm
#19
tried it and it didn’t work. And I need the script to stay inside of the part.
Dfn150
(DevFunNewIdeas)
July 3, 2022, 10:21pm
#20
If you need to keep it in that part, try adding a Touched event