Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Objects To Lua Make By HairBaconGamming --
- local Module_Scripts = {}
- local OBCSkateboard = Instance.new("Tool")
- local Handle = Instance.new("Part")
- local Drop = Instance.new("Sound")
- local Mesh = Instance.new("SpecialMesh")
- local RightGripAttachment = Instance.new("Attachment")
- local RemoteControl = Instance.new("Configuration")
- local ServerControl = Instance.new("RemoteFunction")
- local ClientControl = Instance.new("RemoteFunction")
- local LocalScript = Instance.new("LocalScript")
- local MouseIcon = Instance.new("LocalScript")
- local Script = Instance.new("Script")
- -- Properties --
- OBCSkateboard.Grip = CFrame.new(0.600000024, 0.200000003, 0, -0.000408172607, 0.408248276, 0.912870824, -0.894345462, 0.408248276, -0.1829741, -0.447376817, -0.816496551, 0.364948362)
- OBCSkateboard.GripForward = Vector3.new(-0.9128708243370056, 0.18297410011291504, -0.3649483621120453)
- OBCSkateboard.GripPos = Vector3.new(0.6000000238418579, 0.20000000298023224, 0)
- OBCSkateboard.GripRight = Vector3.new(-0.000408172607421875, -0.8943454623222351, -0.4473768174648285)
- OBCSkateboard.GripUp = Vector3.new(0.40824827551841736, 0.40824827551841736, -0.8164965510368347)
- OBCSkateboard.Name = [[OBCSkateboard]]
- OBCSkateboard.Parent = owner.Backpack
- OBCSkateboard.TextureId = [[http://www.roblox.com/asset/?id=27901917]]
- Handle.BottomSurface = Enum.SurfaceType.Smooth
- Handle.CFrame = CFrame.new(0, 0, 0, 0.433012664, 0.749999702, 0.499999613, -0.465625077, -0.288848042, 0.836515844, 0.771811247, -0.595034838, 0.224143788)
- Handle.Locked = true
- Handle.Name = [[Handle]]
- Handle.Orientation = Vector3.new(-56.77000045776367, 65.8499984741211, -121.80999755859375)
- Handle.Parent = OBCSkateboard
- Handle.Rotation = Vector3.new(-75, 30, -60)
- Handle.Size = Vector3.new(2, 0.4000000059604645, 6)
- Handle.TopSurface = Enum.SurfaceType.Smooth
- Drop.Name = [[Drop]]
- Drop.Parent = Handle
- Drop.SoundId = [[http://www.roblox.com/asset/?id=10548108]]
- Drop.Volume = 1
- Mesh.MeshId = [[http://www.roblox.com/asset/?id=25244821]]
- Mesh.MeshType = Enum.MeshType.FileMesh
- Mesh.Parent = Handle
- Mesh.Scale = Vector3.new(1.149999976158142, 1.149999976158142, 1.149999976158142)
- Mesh.TextureId = [[http://www.roblox.com/asset/?id=27757736]]
- RightGripAttachment.Axis = Vector3.new(0, -1, 0)
- RightGripAttachment.CFrame = CFrame.new(0, -0.200000003, 0, 0, 1, -0, -1, 0, 0, 0, 0, 1)
- RightGripAttachment.Name = [[RightGripAttachment]]
- RightGripAttachment.Orientation = Vector3.new(-0, -0, -90)
- RightGripAttachment.Parent = Handle
- RightGripAttachment.Position = Vector3.new(0, -0.20000000298023224, 0)
- RightGripAttachment.Rotation = Vector3.new(-0, -0, -90)
- RightGripAttachment.SecondaryAxis = Vector3.new(1, 0, 0)
- RemoteControl.Name = [[RemoteControl]]
- RemoteControl.Parent = OBCSkateboard
- ServerControl.Name = [[ServerControl]]
- ServerControl.Parent = RemoteControl
- ClientControl.Name = [[ClientControl]]
- ClientControl.Parent = RemoteControl
- function LocalScript_ScriptfakeXD()
- local script = Instance.new("LocalScript",OBCSkateboard)
- LocalScript = script
- script.Name = [[LocalScript]]
- local require_fake = require
- local require = function(Object)
- local functiom = Module_Scripts[Object]
- if functiom then
- return functiom()
- end
- return require_fake(Object)
- end
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Players = game:GetService("Players")
- RemoteControl = Tool:WaitForChild("RemoteControl")
- ServerControl = RemoteControl:WaitForChild("ServerControl")
- ClientControl = RemoteControl:WaitForChild("ClientControl")
- ToolEquipped = false
- MouseControls = {}
- ClientControl.OnClientInvoke = (function(Mode, Value)
- if Mode == "PlaySound" and Value then
- Value:Play()
- elseif Mode == "PlaySound" and Value then
- Value:Play()
- elseif Mode == "MousePosition" then
- return PlayerMouse.Hit.p
- end
- end)
- function InvokeServer(Mode, Value)
- local ServerReturn = nil
- pcall(function()
- ServerReturn = ServerControl:InvokeServer(Mode, Value)
- end)
- return ServerReturn
- end
- function CheckIfAlive()
- return (((Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
- end
- function Equipped(Mouse)
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- ToolEquipped = true
- if not CheckIfAlive() then
- return
- end
- PlayerMouse = Mouse
- for i, v in pairs(MouseControls) do
- if v then
- v:disconnect()
- end
- end
- MouseControls = {}
- MouseDown = PlayerMouse.Button1Down:connect(function()
- InvokeServer("MouseClick", {Down = true})
- end)
- MouseUp = PlayerMouse.Button1Up:connect(function()
- InvokeServer("MouseClick", {Down = false})
- end)
- end
- function Unequipped()
- ToolEquipped = false
- for i, v in pairs(MouseControls) do
- if v then
- v:disconnect()
- end
- end
- MouseControls = {}
- end
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end
- coroutine.wrap(LocalScript_ScriptfakeXD)()
- function MouseIcon_ScriptfakeXD()
- local script = Instance.new("LocalScript",OBCSkateboard)
- MouseIcon = script
- script.Name = [[MouseIcon]]
- local require_fake = require
- local require = function(Object)
- local functiom = Module_Scripts[Object]
- if functiom then
- return functiom()
- end
- return require_fake(Object)
- end
- --Made by Luckymaxer
- Mouse_Icon = "rbxasset://textures/GunCursor.png"
- Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
- Tool = script.Parent
- Mouse = nil
- function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
- end
- end
- function OnEquipped(ToolMouse)
- Mouse = ToolMouse
- UpdateIcon()
- end
- function OnChanged(Property)
- if Property == "Enabled" then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end
- coroutine.wrap(MouseIcon_ScriptfakeXD)()
- function Script_ScriptfakeXD()
- local script = Instance.new("Script",OBCSkateboard)
- Script = script
- script.Name = [[Script]]
- local require_fake = require
- local require = function(Object)
- local functiom = Module_Scripts[Object]
- if functiom then
- return functiom()
- end
- return require_fake(Object)
- end
- --Made by Luckymaxer
- Tool = script.Parent
- Handle = Tool:WaitForChild("Handle")
- Mesh = Handle:WaitForChild("Mesh")
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- RemoteControl = Tool:WaitForChild("RemoteControl")
- ServerControl = (RemoteControl:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
- ServerControl.Name = "ServerControl"
- ServerControl.Parent = RemoteControl
- ClientControl = (RemoteControl:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
- ClientControl.Name = "ClientControl"
- ClientControl.Parent = RemoteControl
- SkateboardModule = require(199238756)
- SkateboardFunctions = SkateboardModule.SkateboardFunctions
- Functions = SkateboardModule.Functions
- Skateboard = SkateboardFunctions.GetSkateboard("Classic")
- SkateboardFunctions.CreateConfiguration(Tool, Skateboard)
- SkateboardPlatform = SkateboardFunctions.GetSkateboardPlatform(Skateboard)
- Sounds = {
- Drop = Handle:WaitForChild("Drop")
- }
- ToolEquipped = false
- ToolEnabled = true
- Tool.Enabled = true
- ServerControl.OnServerInvoke = (function(player, Mode, Value)
- end)
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- function DropSkateboard()
- local MousePosition = InvokeClient("MousePosition")
- local DesiredAngle = (math.acos((MousePosition - Handle.Position).unit:Dot(Torso.CFrame.lookVector)))
- if DesiredAngle > (math.pi / 2) then --Prevents spawning behind character.
- --return
- end
- local SkateboardSize = Skateboard:GetModelSize()
- local Direction = CFrame.new(Torso.Position, Vector3.new(MousePosition.X, Torso.Position.Y, MousePosition.Z))
- local SkateboardCFrame = Direction + Direction.lookVector * (((Torso.Size.Z / 2) + (SkateboardSize.Z / 2)) * 1.5)
- local SkateboardAngle = CFrame.Angles(0, 0, 0)
- local RayOffset = Vector3.new(-1.5, 0, -1.5)
- local RayPoints = { --Border points and center of skateboard used for casting rays.
- Center = Functions.PositionPart(SkateboardCFrame, 0, 0, 0),
- BackLeft = Functions.PositionPart(SkateboardCFrame, -((SkateboardSize.X / 2) + RayOffset.X), RayOffset.Y, -((SkateboardSize.Z / 2) + RayOffset.Z)),
- BackRight = Functions.PositionPart(SkateboardCFrame, ((SkateboardSize.X / 2) + RayOffset.X), RayOffset.Y, -((SkateboardSize.Z / 2) + RayOffset.Z)),
- FrontLeft = Functions.PositionPart(SkateboardCFrame, -((SkateboardSize.X / 2) + RayOffset.X), RayOffset.Y, ((SkateboardSize.Z / 2) + RayOffset.Z)),
- FrontRight = Functions.PositionPart(SkateboardCFrame, ((SkateboardSize.X / 2) + RayOffset.X), RayOffset.Y, ((SkateboardSize.Z / 2) + RayOffset.Z)),
- }
- local RayData = {
- Area = { --Cast ray to determine if skateboard will spawn inside something.
- Offset = Vector3.new(0, (SkateboardSize.Y / 2), 0),
- Direction = Vector3.new(0, 1, 0),
- Distance = SkateboardSize.Y
- },
- Ground = { --Cast ray to determine if the skateboard can spawn on the ground.
- Direction = Vector3.new(0, -1, 0),
- Distance = (SkateboardSize.Y * 4)
- }
- }
- local Ignore = {Character, Skateboard}
- local HighestGroundRayHit, HighestGroundRayPos --Get the highest point of elevation to spawn the skateboard.
- for i, v in pairs(RayPoints) do
- local GroundRayHit, GroundRayPos = Functions.RayCast(v.p, RayData.Ground.Direction, RayData.Ground.Distance, Ignore)
- if not HighestGroundRayPos or GroundRayPos.Y > HighestGroundRayPos.Y then
- HighestGroundRayHit, HighestGroundRayPos = GroundRayHit, GroundRayPos
- end
- end
- local FullAreaIsEmpty = true --Ensure entire area is empty.
- for i, v in pairs(RayPoints) do
- local AreaIsEmpty = Functions.RegionEmpty((v.p - RayData.Area.Offset), {Min = Vector3.new(0, 0, 0), Max = (RayData.Area.Direction * RayData.Area.Distance)}, Ignore)
- if not AreaIsEmpty then
- FullAreaIsEmpty = false
- end
- end
- if not FullAreaIsEmpty or not HighestGroundRayHit then
- return
- end
- ToolEnabled = false
- local PosX, PosY, PosZ, R00, R01, R02, R10, R11, R12, R20, R21, R22 = SkateboardCFrame:components()
- SkateboardCFrame = CFrame.new(PosX, (HighestGroundRayPos.Y + (SkateboardSize.Y / 2)), PosZ, R00, R01, R02, R10, R11, R12, R20, R21, R22)
- InvokeClient("PlaySound", Sounds.Drop)
- Tool.Parent = nil
- SkateboardFunctions.SpawnSkateboard(Skateboard, (SkateboardCFrame * SkateboardAngle))
- Debris:AddItem(Tool, 0)
- Tool:Destroy()
- end
- function CheckIfAlive()
- return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
- end
- function Activated()
- if not ToolEquipped or not ToolEnabled or not CheckIfAlive() then
- return
- end
- DropSkateboard()
- end
- function Equipped()
- Character = Tool.Parent
- Player = Players:GetPlayerFromCharacter(Character)
- Humanoid = Character:FindFirstChild("Humanoid")
- Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild('UpperTorso')
- if not CheckIfAlive() then
- return
- end
- ToolEquipped = true
- end
- function Unequipped()
- ToolEquipped = false
- end
- Tool.Activated:connect(Activated)
- Tool.Equipped:connect(Equipped)
- Tool.Unequipped:connect(Unequipped)
- end
- coroutine.wrap(Script_ScriptfakeXD)()
- -- End --
- -- Thank for using --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement