✓ Accepted answer
It would be a complicated script (not for me)..
You'd have to add a StringValue called "CurrentOwner" also what in the world are you doing setting a player's .Cancollide to true when they're set to true by default? also finding humanoid is really important, just like finding the true player, to later make sure the player has owned one spawn so he doesn't own TWO spawns..
Game:GetService("Players").PlayerAdded:connect(function(plr)
local Owned=Instance.new("BoolValue",plr) Owned.Value=false end)
local p=script.Parent local Owner=script.Parent:WaitForChild("CurrentOwner")
Owner.Value="None"
p.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and Game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) then
local human=hit.Parent:FindFirstChild("Humanoid")
local player=Game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local Owned=player:WaitForChild("OwnedSpawn")
if Owner.Value=="None" and Owned.Value==false then Owned.Value=true Owner.Value=player.Name
end end end)
Game:GetService("Players").PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(c) local t=c:WaitForChild("Torso")
if Owned.Value:lower()==plr.Name:lower() then t.CFrame=CFrame.new(p.CFrame.p)*CFrame.new(0,3.5,0)
Game:GetService("Players").PlayerRemoving:connect(function(plr)
if plr.Name:lower()==Owner.Value:lower() then Owner.Value="None"
end end)
Haven't tested it.
3 comments
I tested my game with my friend. Once you join the game, we both go to different spawns and do not spawn together on the same one. But once you reset your character or die, thats when we go to each others spawn.
Because it does that once a player touches the spawn. Do not use spawnlocations, dude. just use some normal bricks.
Fixed it. The Neutral property in the spawns was set to true. I just set them to false.