Local:
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
local t = mouse.Target
local block = t.Name
if mouse.Target ~= nil and block == "testBlock" then
print("-Hp")
t:WaitForChild("Health").Value -= 1
end
end)
Script:
local health = script.Parent.Health
local function change()
print(health.Value)
end
health.Changed:Connect(change)
So what’s the task? I want to print something when you click on a block (and in the future to change color). ONLY I want it to be visible to all players. To do this I need to use the server script, right?
I guess so, but then how do I make that local script a server script? Because otherwise, my server script can’t see changes in IntValue, so what should I do?