would love to know what I’m doing wrong here…
I have a door with a proximity prompt and a script that I’m trying to remote to a local script so the event(door opening) is client based…
script I’m trying to debug,
in current state. the door shows the prompt and the first print works… idk how to set up the plr part
proximityprompt.Triggered:Connect(function(proximityprompt)
print("fired")
local plr = game.Players:GetPlayerFromCharacter(proximityprompt.Parent)
if plr then
game.ReplicatedStorage.TestDoor:FireClient(plr)
print("fired2")
end
end)
I think the problem here is the quoted line. The prompt is actually parented to a screengui called “ProximityPrompts” which is a ScreenGui located inside the PlayerGui folder inside the player. The correct way to get the player would be
getting error of “FireClient: player argument must be a Player object -”
dove to google for a bit to see that people are saying server can’t get local players? and I should use another way beside a remote event… but I thought that was the purpose of remote events… to fire local scripts per player
So after doing a bit more research and testing I discovered this
(the code in the picture prints my username)
So all you need to change in your script is,
local plr = proximityprompt --this is the parameter you put in the triggered function
wow I ended up doing it another route with just making the whole script local-script and it somehow streaming enabled messed up all of them before, thanks for the input though will use this soon!