GENERAL PRACTICE
Use :GetService()
to retrieve the Players
Service
ISSUES
The parameter of the .Touched
event is the part that touched the connecting part. With this in mind, if the player touches this part, then the "dar" is whatever part of the character touched the script's parent, and "dar.Parent" is the Character Model of the Player
The :GetPlayerFromCharacter()
function uses the character model to find the player, so you'll need to change the parameter of the :GetPlayerFromCharacter
from "dar" (the part) to dar.Parent (the character model)
REVISED SERVER / LOCAL SCRIPT
1 | script.Parent.Touched:Connect( function (dar) |
2 | if game:GetService( "Players" ):GetPlayerFromCharacter(dar.Parent) then |
3 | local f = Instance.new( "Fire" ) |
This script will place fires onto every part that touches it, if you only want a single fire to be created on each part, you can use an if-then to check that there is not already a fire on the part.
SUGGESTED SERVER / LOCAL SCRIPT
1 | script.Parent.Touched:Connect( function (dar) |
2 | if game:GetService( "Players" ):GetPlayerFromCharacter(dar.Parent) then |
3 | if dar:FindFirstChild( "Fire" ) = = nil then |
4 | local f = Instance.new( "Fire" ) |