|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 15 Sep 2017 07:35 PM |
| oh man extuls the hero again 1!1 ly man!! <3 |
|
|
| Report Abuse |
|
|