When I say ":showlight()" then I get 2 PointLights in my torso instead of 1.
--[Insert the people names that are allowed to use commands in {Admins}.
Owner = {'Player', 'PreyStar'}
Admins = {''}
--[Insert the people names that are not allowed to join the game in {Banned}.
Banned = {'NameHere'}
--[Insert the symbol you want to use before a command is made in {Symbol}.
Symbol = ':'
game.Players.PlayerAdded:connect(function(Plr)
Plr.CharacterAdded:connect(function(Char)
Plr.Chatted:connect(function(Msg)
for i,v in pairs (Banned) do
if v.Name == (Banned) then
v:Kick('You are banned from the game.')
end
end
for i,v in pairs (Owner) do
if Msg:lower() == (':help') then
for i,v in pairs (game.Players:GetPlayers()) do
v.PlayerGui[':help'].Frame.Visible = true
end
end
if Msg:lower() == (Symbol.. 'ff()') then
local ff = Instance.new('ForceField')
ff.Parent = Char
end
if Msg:lower() == (Symbol.. 'clearall()') then
game.Workspace:ClearAllChildren()
end
if Msg:lower() == (Symbol.. 'die()') then
Char.Humanoid.Health = 0
end
--THE TROUBLE IS HERE, BELOW!
if Msg:lower() == (Symbol.. 'showlight()') then
local Light = Instance.new('PointLight', Char.Torso)
Light.Range = 15
Light.Shadows = true
end
if Msg:lower() == (Symbol.. 'givesword()') then
local sword = Instance.new("Tool", Plr.Backpack) sword.Name = "Sword" sword.TextureId = "rbxasset://Textures/Sword128.png"
sword.GripForward = Vector3.new(-1,0,0)
sword.GripPos = Vector3.new(0,0,-1.5)
sword.GripRight = Vector3.new(0,1,0)
sword.GripUp = Vector3.new(0,0,1)
local handle = Instance.new("Part", sword) handle.Name = "Handle" handle.FormFactor = "Plate" handle.Size = Vector3.new(1,.8,4) handle.TopSurface = 0 handle.BottomSurface = 0
local msh = Instance.new("SpecialMesh", handle) msh.MeshId = "rbxasset://fonts/sword.mesh" msh.TextureId = "rbxasset://textures/SwordTexture.png"
local cl = script.LocalScriptBase:Clone() cl.Parent = sword cl.Code.Value = [[
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
local Damage = 15
local SlashSound = Instance.new("Sound", script.Parent.Handle)
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Volume = 1
local LungeSound = Instance.new("Sound", script.Parent.Handle)
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Volume = 1
local UnsheathSound = Instance.new("Sound", script.Parent.Handle)
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Volume = 1
local last = 0
script.Parent.Handle.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") and game.Players:findFirstChild(hit.Parent.Name) and game.Players.LocalPlayer.Character.Humanoid.Health > 0 and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
local tag = Instance.new("ObjectValue", hit.Parent.Humanoid) tag.Value = plr1 tag.Name = "creator" game:service("Debris"):AddItem(tag, 3)
hit.Parent.Humanoid:TakeDamage(Damage)
end
end)
script.Parent.Activated:connect(function()
if not script.Parent.Enabled or game.Players.LocalPlayer.Character.Humanoid.Health <= 0 then return end
script.Parent.Enabled = false
local tick = game:service("RunService").Stepped:wait()
if tick - last <= .2 then
LungeSound:play()
local lunge = Instance.new("StringValue", script.Parent) lunge.Name = "toolanim" lunge.Value = "Lunge"
local frc = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.Torso) frc.Name = "SwordForce" frc.velocity = Vector3.new(0,10,0)
wait(.2)
script.Parent.GripForward = Vector3.new(0,0,1)
script.Parent.GripRight = Vector3.new(0,-1,0)
script.Parent.GripUp = Vector3.new(-1,0,0)
wait(.3)
frc:Destroy() wait(.5)
script.Parent.GripForward = Vector3.new(-1,0,0)
script.Parent.GripRight = Vector3.new(0,1,0)
script.Parent.GripUp = Vector3.new(0,0,1)
else
SlashSound:play()
local slash = Instance.new("StringValue", script.Parent) slash.Name = "toolanim" slash.Value = "Slash"
end
last = tick
script.Parent.Enabled = true
end)
script.Parent.Equipped:connect(function(mouse)
for i,v in pairs(game.Players.LocalPlayer.Character.Torso:children()) do if v.Name == "SwordForce" then v:Destroy() end end
UnsheathSound:play()
script.Parent.Enabled = true
if not mouse then return end
mouse.Icon = "http://www.roblox.com/asset/?id=103593352"
end)]] cl.Disabled = false
end
end
end)
end)
end)

4 comments
This bit of code isn't enough to tell why two objects are being created.
Want me to paste the full admin script? It's 116 lines
Okay, may take a bit to figure out what's going on.
It's an admin script I am making