#Task script

2 messages · Page 1 of 1 (latest)

fresh copper
#

why doesnt my task script work?

#

``wait(1)
local part = game.Workspace.GasStRegion

local pos1 = part.Position - (part.Size / 2)
local pos2 = part.Position + (part.Size / 2)

local region = Region3.new(pos1, pos2)

local TalkTo = game.StarterGui.TaskGui.TalkTo

while true do
wait(0.35)
local PartsInRegion = part.Parent:FindPartsInRegion3(region, part, 9999)
for i, part in pairs(PartsInRegion) do
if part.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
print("Player found in region".. part.Parent.Name)
local Block = Instance.new("Part", workspace)
Block.Size = Vector3.new(0.2, 7.15, 6.2)
Block.Position = Vector3.new(-170.892, 8.875, 189.46)
Block.Transparency = 1
Block.CanCollide = true
Block.Anchored = true
-- play eerie task shown sound
print("Created part")
while TalkTo.TextTransparency >= 0 do
print("Reducing transparency")
wait(0.01)
TalkTo.TextTransparency = TalkTo.TextTransparency - 0.02
end

        print("Transparency load finished")
        wait(1.5)
        TalkTo:TweenSizeAndPosition(UDim2.new(0, 234, 0, 48), UDim2.new(0.065, 0, 0.104, 0), "Out", "Linear", 3.5, false)
        print("Tween finished")
        break
    end
end

end)``