You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?:
I want to add skins for my place but there are many problems with it, I want to make inventory, store and code system -
What is the issue? The problem is that when I teleport to the map, a special script is activated with which I turn into a random character, for example: there are 3 characters of different shapes, different sizes, and so on, and with the help of this script, I will teleport to a special zone where my team and then I have to die very fast and I immediately turn into some kind of character on another spawn with another team!
-
What solutions have you tried so far? I tried to find it on different sources and in the devforum I was looking for something similar, but there are only details on how to make a gui and a script for it, but what I need is not there!
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this script for teleport 1:
local TeleportPart1 = script.Parent.TeleportPart1
local TeleportPart2 = script.Parent.TeleportPart2
TeleportPart1.Touched:Connect(function(hit)
local w = hit.Parent:FindFirstChild("HumanoidRootPart")
if w then
w.CFrame = TeleportPart12CFrame + Vector3.new(0, 5, 0)
TeleportPart2.CanTouch = false
wait(1)
TeleportPart2.CanTouch = true
end
end)
this general script for teleport/change team 2 and randomize character:
local Brick = script.Parent
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = -99999999999999999999
end
end
--[[(this part script is unused soon) ]]
part = script.Parent
part.Touched:Connect(function(TouchedObject)
if TouchedObject.Parent:FindFirstChild("Humanoid") then
print("Switching..")
game.Players:GetPlayerFromCharacter(TouchedObject.Parent).Team = game.Teams["characters"]
end
end)
local PartChar = script.Parent
PartChar.Touched:Connect(function(hit)
local CharRound = math.random(1,3)
if CharRound == 1 then
game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
game.StarterPlayer.Characters.chr1.StarterCharacter:Clone().Parent = game.StarterPlayer
print("chr3 selected.")
elseif CharRound == 2 then
game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
game.StarterPlayer.Characters.chr2.StarterCharacter:Clone().Parent = game.StarterPlayer
print("chr2 selected.")
elseif CharRound == 3 then
game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
game.StarterPlayer.Characters.chr3.StarterCharacter:Clone().Parent = game.StarterPlayer
print("chr3 selected.")
end
end)
local PartChar = script.Parent
Brick.Touched:connect(PlayerTouched)
npc killer script:
part = script.Parent
part.Touched:Connect(function(TouchedObject)
if TouchedObject.Parent:FindFirstChild("Humanoid") then
print("Switching..")
game.Players:GetPlayerFromCharacter(TouchedObject.Parent).Team = game.Teams["Players Team"]
end
end)
local PartChar = script.Parent
PartChar.Touched:Connect(function(hit)
game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
game.ReplicatedStorage.StarterCharacter:Clone().Parent = game.StarterPlayer
--print("Returning to lobby...")
end)
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) and game.Players:FindFirstChild(hit.Parent.name) then --the small edit here makes the script only killing players
human.Health = human.Health - 9999999999999999999999999999999999999999999999999999999 -- Change the amount to change the damage.
end
end
script.Parent.Touched:connect(onTouched)
and script when he died from npc → return to lobby and change team:
local Brick = script.Parent
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = -99999999999999999999
end
end
Brick.Touched:connect(PlayerTouched)
part = script.Parent
part.Touched:Connect(function(TouchedObject)
if TouchedObject.Parent:FindFirstChild("Humanoid") then
print("Switching..")
game.Players:GetPlayerFromCharacter(TouchedObject.Parent).Team = game.Teams.PlayersTeam
end
end)
local PartChar = script.Parent
PartChar.Touched:Connect(function(hit)
game.StarterPlayer:FindFirstChild("StarterCharacter"):Destroy()
game.ReplicatedStorage.StarterCharacter:Clone().Parent = game.StarterPlayer
end)
pls help:(