- What do you want to achieve? Keep it simple and clear!
I want to make that when player touches part time Just for him (locally) changes. (Yes I used localscript)
- What is the issue? Include screenshots / videos if possible!
Time changes for everybody in server.
Time only needed to change for player on the right.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked on YT and forum but I haven’t found answer.
Code in localscript:
local resetLiight1 = workspace.LightChange.ResetLight1
local resetLiight2 = workspace.LightChange.ResetLight2
local resetLiight3 = workspace.LightChange.ResetLight3
local resetLiight4 = workspace.LightChange.ResetLight4
local lighting = game:GetService("Lighting")
lighting.ClockTime = 15
local Tween1 = game:GetService("TweenService"):Create(lighting, TweenInfo.new(2.5), {
ClockTime = 3
})
local Tween2 = game:GetService("TweenService"):Create(lighting, TweenInfo.new(2.5), {
ClockTime = 15
})
changeLight.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
Tween1:Play()
end
end)
resetLiight1.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
Tween2:Play()
end
end)
resetLiight2.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
Tween2:Play()
end
end)
resetLiight3.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
Tween2:Play()
end
end)
resetLiight4.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
Tween2:Play()
end
end)