You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make it so that when there are 2 players in the capsule thing, the rope gets welded to them. -
What is the issue? Include screenshots / videos if possible!
unable to assign property Value. Instance expected, got string -
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
everything
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!
local prompt = script.Parent
local part = prompt.Parent
local teleport = script.Parent.Parent.Parent.Teleport
local player1 = prompt.Player1
local playerName = prompt.PlayerName
local playerName2 = script.Parent.Parent.Parent.Parent.first.prompt.ProximityPrompt.PlayerName
prompt.Triggered:Connect(function(player)
part.Transparency = 1
local character = player.Character
if character then
character:MoveTo(teleport.Position)
prompt.Enabled = false
player1.Value = true
playerName.Value = player.Name
character:WaitForChild("Humanoid").Died:Connect(function()
playerName.Value = ""
wait(2)
player1.Value = false
prompt.Enabled = true
end)
end
end)
-- 2nd script
local prompt = script.Parent
local part = prompt.Parent
local teleport = script.Parent.Parent.Parent.Teleport
local player1 = prompt.Player2
local playerName = prompt.PlayerName
local playerName2 = script.Parent.Parent.Parent.Parent.second.prompt.ProximityPrompt.PlayerName
prompt.Triggered:Connect(function(player)
part.Transparency = 1
local character = player.Character
if character then
character:MoveTo(teleport.Position)
prompt.Enabled = false
player1.Value = true
playerName.Value = player.Name
character:WaitForChild("Humanoid").Died:Connect(function()
playerName.Value = ""
wait(2)
player1.Value = false
prompt.Enabled = true
end)
end
end)
-3rd script
local players = game.Players.LocalPlayer
local character = script.Parent
local playerValue = script.PlayerValue
local runService = game:GetService("RunService")
local vectorForce = Instance.new("VectorForce")
vectorForce.Parent = character.HumanoidRootPart
vectorForce.Attachment0 = character.HumanoidRootPart.RootAttachment
vectorForce.Force = Vector3.new(0,0,0)
vectorForce.ApplyAtCenterOfMass = true
local beam = script.Beam
beam.Parent = character.HumanoidRootPart
beam.Attachment0 = character.HumanoidRootPart.RootAttachment
local maxRange = 15
local strength = 5
function getMass(model)
assert(model and model:IsA("Model"), "Model argument of getMass must be a model")
local mass = 0
for i, v in pairs(model:GetDescendants()) do
if (v:IsA("BasePart")) then
mass += v:GetMass()
end
end
mass = mass * workspace.Gravity
return mass
end
playerValue.Changed:Connect(function()
if playerValue.Value then
beam.Attachment1 = playerValue.Value.HumanoidRootPart.RootAttachment
runService.Heartbeat:Connect(function()
local distance = (character.HumanoidRootPart.Position - playerValue.Value.HumanoidRootPart.Position).Magnitude
local direction = (playerValue.Value.HumanoidRootPart.Position - character.HumanoidRootPart.Position).Unit
local localDirection = character.HumanoidRootPart.CFrame:VectorToObjectSpace(direction)
if distance > maxRange then
local state = character.Humanoid:GetState()
if state == Enum.HumanoidStateType.Freefall then
local forceMagnitude = getMass(character) + (distance * strength)
local finalForce = localDirection * forceMagnitude
vectorForce.Force = finalForce
else
local forceMagnitude = getMass(character) + (distance * (strength * 50))
local finalForce = localDirection * forceMagnitude
vectorForce.Force = finalForce
end
else
vectorForce.Force = Vector3.new(0,0,0)
end
end)
end
(i used an object value for those btw)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.