I have a checkpoint block here and inside it I put for the block to change color when stepped on. #1 It's not working, #2 I need the GetPropertyChangeSignal to trigger the award function.
local myspawn = script.Parent
local serverStorage = game:GetService('ServerStorage')
local levelupreal = Instance:FindFirstChild('levelup')
local function award(player, level, bucks)
local stats = player:findFirstChild('touch')
local Money = player:findFirstChild("leaderstats")
local EarnMoney = Money and Money:findFirstChild('ObbyBucks<|>')
local levelStat = stats and stats:findFirstChild('levelup')
if levelStat then
local levelStatValue = levelStat.Value + level
if EarnMoney then
local EarnMoneyValue = EarnMoney.Value + bucks
end
end
end
myspawn.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local checkpointData = serverStorage:findFirstChild("CheckpointData")
if not checkpointData then
checkpointData = Instance.new("Model", serverStorage)
checkpointData.Name = "CheckpointData"
end
local checkpoint = checkpointData:findFirstChild(tostring(player.userId))
if not checkpoint then
checkpoint = Instance.new("ObjectValue", checkpointData)
checkpoint.Name = tostring(player.userId)
player.CharacterAdded:connect(function(character)
wait()
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
HumanoidRootPart.CFrame = serverStorage[tostring(player.userId)].Value.CFrame
+ Vector3.new(0, 4, 0)
end)
end
myspawn.BrickColor = BrickColor.new(23)
checkpoint.Value = myspawn
myspawn.GetPropertyChangeSignal("BrickColor"):Connect(award(player, 1, 10))
end --award ^ function
end)

2 comments
what line is the error on?
No error, the GetPropertyChangeSignal is supposed to detect change in the spawn block and then launch the award function. The block won't turn blue when it is stepped on though