Professional Documents
Culture Documents
local placement = {}
function tween(o,t,p)
return TweenService:Create(o,TweenInfo.new(1,Enum.EasingStyle.Cubic),p)
end
function transparency(o, v)
tween(o,1,{
Transparency = v
}):Play()
tween(o.UI.NoteUI, 1, {
BackgroundTransparency = v
}):Play()
end
if RunService:IsClient() then
-- Client Side
plr = Players.LocalPlayer
mouse = plr:GetMouse()
char = plr.Character or plr.CharacterAdded:Wait()
placement.Place = nil
else
placement.Place = function(...)
if not RunService:IsServer() then
return
end
local v = {...}
warn("Received")
if _object then
warn("Cloning")
clone.UI.NoteUI.Preview.Text = preview_txt
clone.UI.NoteUI.Autor.Text = string.format("By %s", plrName)
end
end
end
placement.StartDisplay = function(...)
local v = {...}
print(txt)
coroutine.wrap(function()
if not _isBuilding then
_isBuilding = true
warn("Doing")
_displayText = txt
_block = Builds.Note:Clone()
_block.Parent = Framework.Client
_block.UI.NoteUI.Preview.Text = _displayText
_block.UI.NoteUI.Autor.Text = string.format("By %s", plr.Name)
transparency(_block, .5)
local yOrientation = 0
local ignoreList = {char, _block, Framework.Server}
--[[
local _rayParams = RaycastParams.new()
_rayParams.FilterDescendantsInstances = {char;_block}
_rayParams.IgnoreWater = true
_rayParams.FilterType = Enum.RaycastFilterType.Blacklist
if instance then
if position then
--local pos = _result.Position
--_blockCFrame = CFrame.new(math.floor(pos.X / _gridSize) *
_gridSize, pos.Y + _block.Size.Y/2,math.floor(pos.Z / _gridSize) * _gridSize)
task.spawn(function()
local _touched = _block:GetTouchingParts()
local _detected = false
task.wait()
end
if _detected then
_canPlace = false
else
_canPlace = true
end
if _canPlace then
tween(_block, .35, {
Color = Color3.fromRGB(155, 255, 175)
}):Play()
else
tween(_block, .35, {
Color = Color3.fromRGB(255, 88, 88)
}):Play()
end
end)
warn("Stopped")
end
end)()
end
placement.PlaceRequest = function(...)
warn("Place request")
print(_canPlace,_block,_blockCFrame)
if _canPlace and _block and _blockCFrame ~= nil and dif > 1 then
warn("Success")
_lastClicked = tick()
transparency(_block, 0)
_canPlace = false
_isBuilding = false
_block:Destroy()
_blockCFrame = nil
_animCFrame = nil
_displayText = nil
end
end
return placement