#i hate ts pmo
1 messages · Page 1 of 1 (latest)
You have to actually supply the player you're firing the event to when using FireClient
wgat does that mean
so i get the player¿
gat 8 washington
It means you're missing parameters in :FireClient(), you have to see if the part you hit belongs to the character of a player
oh okay
ill try to fix this
thx
https://create.roblox.com/docs/reference/engine/classes/Players#GetPlayerFromCharacter is a good function to use
Before accessing hit.Parent.Humanoid, you should check if it exists. Otherwise, it’ll error out and stop running.
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Sit = true
humanoid.WalkSpeed = 0
game.ReplicatedStorage.EventoCanonico3:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))
end
You're currently using FireClient() with no arguments, but it must include the target player. So you need this:
game.ReplicatedStorage.EventoCanonico3:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))
You are using poop, image_sequence, and mugre, but they’re not initialized anywhere in the code shown. Make sure you have:
local poop = true
local image_sequence = 1
local mugre = 1
You're using while poop == true do with no wait() inside it — this causes an infinite, frame-freezing loop.
while poop == true do
local text = ">WAAAAA!!!!!!"
task.wait(0.1)
end
like this?
Uhm no, so that code in the link wasn't meant to be like "here's how you use it", it was saying the Players service function GetPlayerFromCharacter was equivalent to that. So while that function would also work, it's code you didn't need to write
Is the subject of the event who the script is attached to? Or should it be whoever touched?
mmm
So like why do you fire the event?
dialog
Then you'd probably want hit.Parent not script.Parent for getPlayerFromCharacter
ye ye i saw that
why are you weird bro
get out of here
Was that weird?
Could be AI, I dunno, I was here before he posted it and he took time to write it. 🤷♂️
i will internalize this knowledge
aint nobody writing "You're using while poop == true do with no wait() inside it — this causes an infinite, frame-freezing loop."
dude i have a variable called poop in my game what a coincidence
whattt bro thats wild
?
🗜️
** You are now Level 6! **