0 specification on what kurya or any of this stuff does. I see you disable their movement and CFrame them into the hiding area but why using startergui? Player Gui is how to access people’s gui. I also don’t really recommend using the server for this… a little bit of lag and your CFrames won’t work properly. Anytime you are handling game mechanics it is always better to use local scripts. Handle information(Example: Data Stores) on the server and mechanics(Example: Humanoid properties) on the client
local plr = game.Players.LocalPlayer
local char = plr.Character
plr.PlayerGui.healthinvcam.button.MouseButton1Click:Connect(function() --makes the gui clickable
if char and char:FindFirstChild('Humanoid') and char:FindFirstChild('HumanoidRootPart') then --checks the parts we are accessing to make sure we are not accessing non-existent parts of their character
char.Humanoid.WalkSpeed = 0
char.HumanoidRootPart.CFrame = script.Parent.Parent.CFrame --Change this to the part that it originally was not using script parent the actual part name
task.wait(4) --delay so that they can't move for 4 seconds when CFraming
char.Humanoid.WalkSpeed = 16
char.HumanoidRootPart.CFrame = workspace.hiddenpart1.CFrame
end
end)
look,i think you didnt actually undestand what i meant.all i need is to access “kurya” and make his “Damage” script enabled to false when in the closet.
I gave you a completely working script with detailed information how it works and what you should do with it. It goes in a local script so you can click that “healthincam” button. I still have no idea what kurya is. Unless you post a picture of your workspace, you are on your own with disabling the damage script. Please try and be more specific next time so we can help you. Thank you!
wait(3)
local kurya = game:GetService("ReplicatedStorage"):FindFirstChild("Kurya"):Clone()
local hitpart = kurya:FindFirstChild("hitpart")
local approach = kurya:FindFirstChild("Approach")
local digus
while wait(1) do
print("approaching!")
approach:Play()
digus = math.random(120,250)
kurya.Parent = workspace:FindFirstChild("Assets")
kurya.CanCollide = false
kurya.CFrame = workspace:FindFirstChild("smth1").CFrame
hitpart.CFrame = workspace:FindFirstChild("smth1").CFrame
while wait(.0000005) do
for hui = 0,35 do
kurya.Position = kurya.Position + Vector3.new(0,0,math.cos(tick()/2))
hitpart.Position = hitpart.Position + Vector3.new(0,0,math.cos(tick()/2))
end
end
end
It’s because you are trying to clone it before it actually exists. I can show you how to clone him properly. You will obviously need to use a remote event for this to work because we need to pass information to the server to clone create the rush entity. I can help you do this.
--Put this LOCAL script in startercharacterscripts
local plr = game.Players.LocalPlayer
local char = plr.Character
local rs = game.ReplicatedStorage
plr.PlayerGui.healthinvcam.button.MouseButton1Click:Connect(function()
rs.Kurya_Event:FireServer() --Create a remote event named "Kurya" in replicated storage and let this do the work for you
if char and char:FindFirstChild('Humanoid') and char:FindFirstChild('HumanoidRootPart') then
char.Humanoid.WalkSpeed = 0
char.HumanoidRootPart.CFrame = script.Parent.Parent.CFrame
char.Humanoid.WalkSpeed = 16
char.HumanoidRootPart.CFrame = workspace.hiddenpart1.CFrame
end
end)
--Put this SCRIPT(Not Local) in serverscriptservice
local kurya = game:GetService("ReplicatedStorage"):WaitForChild("Kurya_Entity"):Clone()
local hitpart = kurya:WaitForChild("hitpart")
local approach = kurya:WaitForChild("Approach")
game.ReplicatedStorage.Kurya_Event.OnServerEvent:Connect(function()
wait(3)
local digus
while wait(1) do
print("approaching!")
approach:Play()
digus = math.random(120,250)
if workspace:FindFirstChild("Assets") and workspace:FindFirstChild("smth1") then
kurya.Parent = workspace.Assets
kurya.CanCollide = false
kurya.CFrame = workspace.smth1.CFrame
hitpart.CFrame = workspace.smth1.CFrame
end
while wait(.0000005) do
for hui = 0,35 do
kurya.Position = kurya.Position + Vector3.new(0,0,math.cos(tick()/2))
hitpart.Position = hitpart.Position + Vector3.new(0,0,math.cos(tick()/2))
end --end for loop
end --end second while wait loop
end --end first while wait loop
end) --end remote event
You need to create a remote event named “Kurya_Event” put it in replicated storage, rename Kurya the entity that is already in replicated storage to “Kurya_Entity”, and put the scripts where it says to put them.
--Put this LOCAL script in startercharacterscripts
local plr = game.Players.LocalPlayer
local char = plr.Character
local rs = game.ReplicatedStorage
plr.PlayerGui.healthinvcam.button.MouseButton1Click:Connect(function()
if char and char:FindFirstChild('Humanoid') and char:FindFirstChild('HumanoidRootPart') then
char.Humanoid.WalkSpeed = 0
char.HumanoidRootPart.CFrame = script.Parent.Parent.CFrame
local In_Closet = Instance.new("StringValue")
In_Closet.Parent = char
In_Closet.Name = "In_Closet"
rs.Kurya_Event:FireServer(In_Closet)
task.wait(4)
In_Closet:Destroy()
char.Humanoid.WalkSpeed = 16
char.HumanoidRootPart.CFrame = workspace.hiddenpart1.CFrame
end
end)
--Put this SCRIPT(Not Local) in serverscriptservice
local kurya = game:GetService("ReplicatedStorage"):WaitForChild("Kurya_Entity"):Clone()
local hitpart = kurya:WaitForChild("hitpart")
local approach = kurya:WaitForChild("Approach")
game.ReplicatedStorage.Kurya_Event.OnServerEvent:Connect(function(player, In_Closet)
wait(3)
local digus
while wait(1) do
print("approaching!")
approach:Play()
digus = math.random(120,250)
if workspace:FindFirstChild("Assets") and workspace:FindFirstChild("smth1") then
kurya.Parent = workspace.Assets
kurya.CanCollide = false
kurya.CFrame = workspace.smth1.CFrame
if In_Closet then
hitpart.CFrame = workspace.smth1.CFrame
end
end
while wait(.0000005) do
for hui = 0,35 do
kurya.Position = kurya.Position + Vector3.new(0,0,math.cos(tick()/2))
hitpart.Position = hitpart.Position + Vector3.new(0,0,math.cos(tick()/2))
end --end for loop
end --end second while wait loop
end --end first while wait loop
end) --end remote event
I am assuming that the hitpart is what kills them so basically what this does is it checks if they are in the closet and if they are it will not kill them otherwise it will
Let me know what happens. It’s very hard to do this without seeing what’s in the workspace so i’m just guessing at this point which does which because it is labeled very poorly lol. I would imagine it’s pretty close to working though so it would only be something small needed to be changed if this doesn’t work