So i have a script that tell what player is standing on but i dont think it is the best way possible and maybe it will cuz lag anyway so what i do is
get the character of the player than i connect every part - meshpart to touch event after that i fire event to the server i can change the fire part but the isuss here is how to tell what player is standing on
-- local script in startcharacter scripts
local Character = script.Parent
local PartMaterial = nil
local replicatedStorge = game:GetService("ReplicatedStorage")
local event = replicatedStorge:WaitForChild("PressedQ")
for _,item in Character:GetChildren() do
if item:IsA("MeshPart") or item:IsA("Part") then
item.Touched:Connect(function(Part)
if Part.Material ~= PartMaterial then
event:FireServer(Part.Material)
PartMaterial = Part.Material
print(PartMaterial)
end
end)
end
end
So is there a better way than connecting every part in the character with touch event