Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local function isnumber(thingy)
- if type(thingy) == "number" then
- return true
- else
- return false
- end
- end
- local function findplayer(g)
- local thing = nil
- local stringtosearch = g
- for i, v in ipairs(game.Players:GetChildren()) do
- local stringwesearchin = v.Name
- local search = string.match(stringwesearchin,stringtosearch)
- if search then
- thing = v
- end
- end
- return(thing)
- end
- local function disco(targetpart)
- while wait(0.2) do
- targetpart.Color = Color3.new(math.random(1,255),math.random(1,255),math.random(1,255))
- end
- end
- local function anchor(targetpart)
- if targetpart.Anchored == true then
- targetpart.Anchored = false
- else
- targetpart.Anchored = true
- end
- end
- --main script
- plr.Chatted:Connect(function(msg)
- if msg == "/discopart" then
- if mouse.Target == nil then
- else
- disco(mouse.Target)
- end
- elseif msg == "/anchorpart" then
- if mouse.Target == nil then
- else
- anchor(mouse.Target)
- end
- elseif msg:sub(1,9) == "/respawn " then
- local thingy = findplayer(msg:sub(10))
- if thingy == nil then
- thingy:LoadCharacter()
- end
- elseif msg:sub(1,13) == "/destroychar " then
- local gamer = findplayer(msg:sub(14))
- if gamer == nil then
- else
- gamer.Character:Destroy()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment