My proximityprompt requires you to hold it down for 0.5 seconds or something. Thats why Im not using ProximityPrompt.Triggered
Change your NoobKit to ReplicatedStorage.
I moved the folder from ServerStorage to ReplicatedStorage and changed ServerStorage to ReplicatedStorage. Same error
Workspace.Shop.Noob Kit.Kit NPC.ProximityPrompt.Script:25: attempt to index nil with 'HumanoidRootPart'
Move the stuff to its original place, and try this:
local prompt = script.Parent
prompt.TriggerEnded:Connect(function(player)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
if game:GetService(("MarketplaceService")):UserOwnsGamePassAsync(userId,gamePassId) == false then
print("Player Does Not Have Gamepass")
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)
else
print("Player Has Gamepass")
local character = player.Character
character.Archivable = true
local clone = character:Clone()
clone.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character.HumanoidRootPart.CFrame = CFrame.new(clone.HumanoidRootPart.Position)
end
end)
I think you have to set the character archivable to true. The character archivable property is set to false by default.
script error:
Workspace.Shop.Noob Kit.Kit NPC.ProximityPrompt.Script:42: Expected ')' (to close '(' at line 3), got <eof>
You must have accidentally deleted " ) ".
Script
local prompt = script.Parent
prompt.TriggerEnded:Connect(function(player)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then
print("Player Does Not Have Gamepass")
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)
else
print("Player Has Gamepass")
local character = player.Character
character.Archivable = true
local clone = character:Clone()
clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
end
end)
Okay so good news, it works, butâŚ:
that might have been an error by me, but the character is unmovable.
Hmm⌠Maybe the HumanoidRootPart is anchored. I made it unanchored in the new script.
New Script
local prompt = script.Parent
prompt.TriggerEnded:Connect(function(player)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then
print("Player Does Not Have Gamepass")
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)
else
print("Player Has Gamepass")
local character = player.Character
character.Archivable = true
local clone = character:Clone()
clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
player.Character:WaitForChild("HumanoidRootPart").Anchored = false
end
end)
If the character works to move, but the animation doesnât, you sometimes just have to disable the animation script inside the player and re-enable it.
New Script
local prompt = script.Parent
prompt.TriggerEnded:Connect(function(player)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then
print("Player Does Not Have Gamepass")
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)
else
print("Player Has Gamepass")
local character = player.Character
character.Archivable = true
local clone = character:Clone()
clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
player.Character:WaitForChild("HumanoidRootPart").Anchored = false
pcall(function()
player.Character.Animate.Disabled = true
player.Character.Animate.Disabled = false
end)
end
end)
LocalScript in StarterCharacterScripts
game.Workspace.CurrentCamera.CameraSubject = script.Parent:WaitForChild("Humanoid")
i still get the same problemsâŚ
Does the camera work at least?
Nope, camera is still stuck in one place - it doesnt follow the player.
Change the script to this, and move the LocalScript inside of the script, but make the LocalScript disabled:
local prompt = script.Parent
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
print("Player Has Gamepass")
character.Archivable = true
local clone = character:Clone()
clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
player.Character:WaitForChild("HumanoidRootPart").Anchored = false
local LS = script:WaitForChild("LocalScript"):Clone()
LS.Parent = player.Character
LS.Disabled = false
pcall(function()
player.Character.Animate.Disabled = true
player.Character.Animate.Disabled = false
end)
end)
end)
try parent last
player.Character = newchar
newchar.Parent = workspace
just to fix camera
ummm i got this error:
Maximum event re-entrancy depth exceeded for Player.CharacterAdded
andâŚ
i started off as the character and my spawn was so far awayâŚ
Oh- oops. I mustâve mixed up my testing script with yoursâŚ
Change script to this:
Script
local prompt = script.Parent
prompt.TriggerEnded:Connect(function(player)
print(player)
local gamePassId = 22080195 -- Gamepass ID here
local userId = player.userId
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then
print("Player Does Not Have Gamepass")
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)
else
print("Player Has Gamepass")
local character = player.Character
character.Archivable = true
local clone = character:Clone()
clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)
local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit
local newchar = newcharLocation:Clone()
newchar.Parent = workspace
newchar.Name = player.Name
player.Character = newchar
player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
player.Character:WaitForChild("HumanoidRootPart").Anchored = false
local LS = script:WaitForChild("LocalScript"):Clone()
LS.Parent = player.Character
LS.Disabled = false
pcall(function()
player.Character.Animate.Disabled = true
player.Character.Animate.Disabled = false
end)
end
end)
But, besides⌠Did everything else work?
yayyyy it works now, except for animation
Can you show me the inside of the NPC character when youâre not testing? The animation script could be missingâŚ
I realised that mistake earlier so I copied my characterâs animate script into the npc:
doesnt work thoâŚ
p.s. the humanoidrootpart error is gone in R15 i just tried