Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CS = game:GetService("CollectionService")
- local function Event(instance, attributes)
- local ShadowX = attributes.ShadowX or 4
- local ShadowY = attributes.ShadowY or 4
- local ShadowColor = attributes.ShadowColor or Color3.fromRGB(44, 44, 44)
- -- Don't want to clone the children
- for i, v in pairs(instance:GetChildren()) do
- v.Archivable = false
- end
- -- Create shadow
- local Clone = instance:Clone()
- Clone.Size = UDim2.fromScale(1, 1)
- Clone.AnchorPoint = Vector2.new(0, 0)
- Clone.Position = UDim2.new(0, ShadowX, 0, ShadowY)
- Clone.ZIndex -= 5
- Clone:SetAttribute("EzEvent", nil) -- Remove any events connected to the clone
- CS:RemoveTag(Clone, "EzEvent") -- Make sure we don't accidentally do something stupid
- Clone.Parent = instance
- if (Clone.ClassName:match("Image")) then
- Clone.ImageColor3 = ShadowColor
- else
- Clone.BackgroundColor3 = ShadowColor
- end
- -- Reset archivable
- for i, v in pairs(instance:GetChildren()) do
- v.Archivable = false
- end
- end
- return Event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement