generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Script that kills players without a specific shirt

Previous Thread :: Next Thread 
StoneIsIand is not online. StoneIsIand
Joined: 15 Apr 2012
Total Posts: 984
15 Sep 2017 07:00 PM
So I got part 1 a door that opens and closes but can someone do me a teeeeeny favour and show me a script that kills characters who dont have for example id:969770300 but doesnt affect anyone with that shirt??
Report Abuse
EagleFireClaw is not online. EagleFireClaw
Joined: 27 Dec 2014
Total Posts: 498
15 Sep 2017 07:05 PM
-- do not use unless you know what it means for your own good game.Workspace.Door.Touched:Connect(hit) local player = game.Players.LocalPlayer if game.MarketPlaceService:PlayerOwnsAsset(player, 969770300) and game.Workspace[player.Name].Shirt.ShirtTemplate == "rbxassetid//969770300" then print("By EagleFireClaw") game.Workspace.Door.CanCollide.Enabled = false game.Workspace.Door.Transparency = 1 else print("By EagleFireClaw") player.Character:WaitForChild("Humanoid").Health = player.Character:WaitForChild("Humanoid").Health - ########## end end) ################### Make A Deal"]:ClearAllChildren()
Report Abuse
Extuls is online. Extuls
Joined: 02 Jan 2009
Total Posts: 5557
15 Sep 2017 07:06 PM
local VipId = 0 --The id of asset (no gamepasses or badges) player needs to own
local OpenTime = 3 --Time door is open
local OpenTransparency = 0.75 --Transparency when open

local Door = script.Parent --Don't change this if the script is in the door

--Edit nothing under here
local PlayersService = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")

local Whitelist = {} --Players already known to own vip by the server

local ClosedTransparency = Door.Transparency

--Used for checking if player owns the asset
local function PlayerOwnsVip(Player)
--return true if already owns it
if Whitelist[Player.UserId] then
return true
end

--Wrap in pcall in case of error
local Success, OwnsVip = pcall(function() return MarketplaceService:PlayerOwnsAsset(Player, VipId) end)
if Success and OwnsVip then
Whitelist[Player.UserId] = true
return true
elseif Success and not OwnsVip then
return false
end

return nil
end

local Debounce = false
Door.Touched:Connect(function(Hit)
local Player = PlayersService:GetPlayerFromCharacter(Hit.Parent)
if Player then
local OwnsVip = PlayerOwnsVip(Player)
if OwnsVip == true then
if not Debounce then
Debounce = true
Door.CanCollide = false
Door.Transparency = OpenTransparency
wait(OpenTime)
Door.Transparency = ClosedTransparency
Door.CanCollide = true
Debounce = false
end
elseif OwnsVip == false then
local Character = Player.Character
if Character then
Character:BreakJoints()
end
end
end
end)
Report Abuse
StoneIsIand is not online. StoneIsIand
Joined: 15 Apr 2012
Total Posts: 984
15 Sep 2017 07:06 PM
aw man its hashtagged
Report Abuse
kylerzong is not online. kylerzong
Joined: 06 Aug 2011
Total Posts: 659
15 Sep 2017 07:08 PM


id = 236326
script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
character = player.Character
end
if player == nil or character == nil or id == 0 then return(false) end

if not game:GetService("MarketplaceService"):PlayerOwnsAsset(player,id) then
character.Humanoid:TakeDamage(character.Humanoid.MaxHealth)
end


end)
Report Abuse
StoneIsIand is not online. StoneIsIand
Joined: 15 Apr 2012
Total Posts: 984
15 Sep 2017 07:31 PM
^ that is brilliant scripting but for some reason the death isnt instantaneous infact it takes like 20 seconds of me standing on the block still for it to kill me
Report Abuse
StoneIsIand is not online. StoneIsIand
Joined: 15 Apr 2012
Total Posts: 984
15 Sep 2017 07:35 PM
oh man extuls the hero again 1!1 ly man!! <3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image