script.Parent.Touched:Connect(function(hit)
if hit.Name == "HumanoidRootPart" then
if game:GetService("Players")(hit.Parent.Name).leaderstats.Rebirths >= 10 then
game:GetService("ReplicatedStorage").checkData:FirClient(game:GetService("Players")(hit.Parent.Name), Portal1)
end
end
end)
COMMUNITY QUESTION
Why does it say expected parsing got "," on line 4?
1 answer
I've revamped your script to hopefully get it working to your liking.
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
if plr.leaderstats.Rebirths.Value >= 10 then
game:GetService("ReplicatedStorage").checkData:FireClient(plr.Name), Portal1)
end
end)
3 comments
0
the comma doesnt work on line 5
0
You forgot a bracket, plus it should be "plr" not "plr.Name"
0
where does the bracket go?
This discussion is preserved as it was. New answers, comments, and votes are closed.

10 comments
line 3
Consider using GetPlayerFromCharacter(), it has a reason to be used here
where do i put that then
Line 2: if game.Players:GetPlayerFromCharacter(hit.Parent) then
Indexing a variable should also be done using square brackets instead of parenthesis, so that Lua assumes that you're treating the child as a member of a dictionary. An example of this is game.Players[hit.Parent.Name].
FirClient OmegaLul
omg im dum lol
wait, thats not wut is says in my script tho
You spelled "Fire" wrong.
well its not wrong in my actuall script tho