H0angg
(゠ヅ゠)
August 22, 2024, 5:47am
#1
i want to make a revive system in my game and im sending player to revive as a objectvalue through remote event to server script
the problem is it keeps attempt to index nil or sometimes it revives me instead
where it revives me (here im chosing to revive “h0angg2763”)
the script that caused it: (server side)
where it attempts to index nil: (with output)
the script that caused it: (server side)
i have tried many solutions and look in the documentation about objectvalue and remoteevent and them all did not work
scripts in client side
i think they just occur at server script
please help me thank you
2 Likes
When using :FireServer, don’t provide the player as the first argument. It’s automatically passed when calling FireServer.
Basically, replace line 11 of the client side script with
rs:FindFirstChild("RecoveredSomeone"):FireServer(playerVal, section)
3 Likes
H0angg
(゠ヅ゠)
August 22, 2024, 7:33am
#3
attempt to index nil with loadcharacter()
it happened again
1 Like
I don’t get what line 37 is trying to achieve. It tries to load a character from a value which doesn’t make sense at all
2 Likes
H0angg
(゠ヅ゠)
August 22, 2024, 7:45am
#5
its an object value but i knew it earlier so i removed the value
(i was trying to revive the chosen player)
1 Like
if you want to load a character, you could simply…
game:GetService("Players"):FindFirstChild(playerName):LoadCharacter()
2 Likes
H0angg
(゠ヅ゠)
August 22, 2024, 8:02am
#7
1 Like
H0angg
(゠ヅ゠)
August 22, 2024, 9:36am
#8
also it still returns attempt to index nil with character, did i do anything wrong?
rp:FindFirstChild("RecoveredSomeone").OnServerEvent:Connect(function(plr, playerval, section)
game:GetService("Players"):FindFirstChild(playerval.Value):LoadCharacter()
(also i changed it to stringvalue)
1 Like
foodeggs7
(SubToParcIeDev_onyt)
August 22, 2024, 9:52am
#9
Well on the server you need to call (player: Player)
rp:FindFirstChild("RecoveredSomeone").OnServerEvent:Connect(function(player: Player, playerval, section)
player:FindFirstChild(playerval.Value):LoadCharacter()
2 Likes
H0angg
(゠ヅ゠)
August 22, 2024, 9:58am
#11
rp:FindFirstChild("RecoveredSomeone").OnServerInvoke:Connect(function(plr, playerval, section)
game:GetService("Players"):FindFirstChild(playerval.Value):LoadCharacter()
1 Like
my bad i didnt read the full thing so i never realized that u were returning for something
probably stick to remoteevents, u wont need remotefunctions for that
can you try checking what the value section:FindFirstChild("Player").Value"
is?
1 Like
H0angg
(゠ヅ゠)
August 22, 2024, 10:01am
#14
its a object value but it didnt work so i changed it to a string value
then locating the player thru the string value
you cant call :LoadCharacter() on a string, try doing
game:GetService("Players")[section.Player.Value]:LoadCharacter()
1 Like
H0angg
(゠ヅ゠)
August 22, 2024, 10:13am
#16
now it attempts to index nil with the value
seems that the value from the client is a nil
now i just figured how, the value is only client modified so it just only recieve nil value
it is ok to modify the value with normal script?
yea just modify it with a server script
1 Like
foodeggs7
(SubToParcIeDev_onyt)
August 22, 2024, 11:26am
#18
I think just to get the player who fired the remote for
1 Like
H0angg
(゠ヅ゠)
August 22, 2024, 11:36am
#19
ooooooh i understand thank you