I have tried many times and have a script that just doesn't work
local part = script.Parent part.Touched:Connect(function(hit) print("Time part was touched by" .. hit.Name) game.Lighting.ClockTime =14
What have I done wrong?
This a basic syntax error I highly suggest you open the output for debugging. Also format your code correctly
local part = script.Parent part.Touched:Connect(function(hit) print("Time part was touched by" .. hit.Name) game.Lighting.ClockTime = 14 end) -- You need to end the function
local Players = game:GetService("Players") local part script.parent.Touched:Connect(function(part) local player = Players:GetPlayerFromCharacter(part.Parent) if not player then return end print("Time was changed by " .. player.Name) game.Lighting.ClockTime = math.random(23) end)
Something like this.