I need a script to log the players name if they've stepped on a part.
This can be done by using this code
local Players = game:GetService("Players") local player = Players.LocalPlayer local part = <Put part identifier here> part.Touched:Connect(function(hit) if hit ~= nil then local PlayerName = hit:GetFullName() local StringValue = Instance.new("StringValue") StringValue.Parent = <StringValue's parent> StringValue.Value = tostring(PlayerName) end)
Here, it has also created a string value so that it can be stored in DataStore, ReplicatedStorage, or any other place. To make identification of the StringValue easier, assign it a unique name like:
StringValue.Name = tostring(PlayerName).."_StringValue"