Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DS = game:GetService('DataStoreService')
- local SS = game:GetService('ServerStorage')
- local tableData = DS:GetDataStore('Stats')
- local LS = SS:WaitForChild('LvlStats')
- local startData = {
- Joe = 0, Yuri = false, Ligma = 'Balls', XP = 0, maxXp = 5000, lvl = 1
- }
- game.Players.PlayerAdded:Connect(function(plr)
- local stFolder = Instance.new('Folder')
- stFolder.Name = "Stats"
- stFolder.Parent = plr
- local Data
- Data = tableData:GetAsync(plr.userId)
- for i,v in pairs(startData) do
- if type(v) == 'number' then
- local Num = Instance.new('IntValue')
- Num.Name = i
- Num.Value = v
- Num.Parent = stFolder
- elseif type(v) == 'boolean' then
- local Bool = Instance.new('BoolValue')
- Bool.Name = i
- Bool.Value = v
- Bool.Parent = stFolder
- elseif type(v) == 'string' then
- local Ito = Instance.new('StringValue')
- Ito.Name = i
- Ito.Value = v
- Ito.Parent = stFolder
- end
- end
- if Data then
- for i,v in pairs(Data) do
- plr.Stats[i].Value = v
- end
- end
- plr.Stats.XP.Changed:Connect(function(plr)
- local XPE = plr.Stats.XP
- local MXPE = plr.Stats.maxXP
- if XPE >= MXPE then
- XPE.Value = XPE.Value - MXPE.Value
- MXPE.Value = MXPE.VALUE * 1.25
- plr.Stats.lvl.Value = plr.Stats.lvl.Value + 1
- end
- end)
- end)
- game.Players.PlayerRemoving:Connect(function(plr)
- local Data = {}
- for i,v in pairs(plr.Stats:GetChildren()) do
- Data[v.Name] = v.Value
- end
- tableData:SetAsync(plr.userId, Data)
- end)
- --[[
- The
- Ultra
- Ray
- Casting
- kid
- ]]
- --// Services \\--
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local TS = game:GetService("TweenService")
- --// Variables \\--
- local Remote = ReplicatedStorage.PikaBeam
- local TI = TweenInfo.new(
- 0.4,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local PP = {
- Size = Vector3.new(100,100,100);
- Transparency = 1
- }
- --// Settings \\--
- local Damage = 30
- Remote.OnServerEvent:Connect(function(plr, Mouse)
- local Char = plr.Character or plr.CharacterAdded:Wait()
- local ray = Ray.new(Char.HumanoidRootPart.CFrame.p, (Mouse.p - Char.HumanoidRootPart.CFrame.p).unit * 200)
- local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
- local beam = Instance.new("Part")
- beam.BrickColor = BrickColor.new("New Yeller")
- beam.FormFactor = "Custom"
- beam.Material = "Neon"
- beam.Transparency = 0.25
- beam.Anchored = true
- beam.Locked = true
- beam.CanCollide = false
- beam.Parent = workspace
- local distance = (Char.HumanoidRootPart.CFrame.p - position).magnitude
- beam.Size = Vector3.new(0.3, 0.3, distance)
- beam.CFrame = CFrame.new(Char.HumanoidRootPart.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
- game:GetService("Debris"):AddItem(beam, 0.1)
- local Explo = game.ReplicatedStorage.PikaExplosion:Clone()
- Explo.Parent = part
- Explo.CFrame = CFrame.new(Char.HumanoidRootPart.CFrame.p,position)*CFrame.new(0,0,-distance)
- local Debounce = true
- Explo.Touched:Connect(function(h)
- if h.Parent:FindFirstChild('Humanoid') and h.Parent.Name ~= plr.Name and Debounce then
- Debounce = false
- local Enemy = h.Parent.Humanoid
- Enemy:TakeDamage(Damage)
- Damage = 0
- wait(0.5)
- Damage = 30
- end
- end)
- local Tween = TS:Create(Explo,TI,PP)
- Tween:Play()
- if part then
- local humanoid = part.Parent:FindFirstChild("Humanoid")
- if not humanoid then
- humanoid = part.Parent.Parent:FindFirstChild("Humanoid")
- end
- if humanoid then
- humanoid:TakeDamage(30)
- end
- wait(0.5)
- Explo:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement