im trying to make teleport system that takes the full power or anyone in the party but im failing
the values the players names are on is an ObjectValue how can i fix this issue to teleport them
Option1 = {"Party Teleport", "Enjoy.",
func = function(plr)
local Gravity_Chamber = 10539033270
local partymembers = {}
local Stats = MainModule.GetStats(plr)
local Players = game:GetService("Players")
local MyPartyFolder = game.ReplicatedStorage.Parties:FindFirstChild(plr.Name)
if Stats.Zeni.Value >= Price then
Stats.Zeni.Value = Stats.Zeni.Value - Price
if MyPartyFolder.Player2.Value ~= "" then partymembers = {Players:FindFirstChild(MyPartyFolder.Player1.Value), Players:FindFirstChild(MyPartyFolder.Player2.Value)} end
-- if MyPartyFolder.Player3.Value ~= "No One" then partymembers = {Players:FindFirstChild(MyPartyFolder.Player1.Value), Players:FindFirstChild(MyPartyFolder.Player2.Value), Players:FindFirstChild(MyPartyFolder.Player3.Value) }return end
-- if MyPartyFolder.Player4.Value ~= "No One" then partymembers = {Players:FindFirstChild(MyPartyFolder.Player1.Value), Players:FindFirstChild(MyPartyFolder.Player2.Value), Players:FindFirstChild(MyPartyFolder.Player3.Value), Players:FindFirstChild(MyPartyFolder.Player4.Value) }return end
game:GetService("TeleportService"):Teleport(Gravity_Chamber,partymembers) -- the part saying Unable to cast value to Object
end
end
},
also i haven’t been to sleep in over 17 hours I been scripting none stop and this is an issue i came across while scripting so i decided to ask for help after trying many ways
Option1 = {"Party Teleport", "Enjoy.",
func = function(plr)
local partymembers = {}
local Stats = MainModule.GetStats(plr)
local myparty = game.ReplicatedStorage.Parties:FindFirstChild(plr.Name)
if Stats.Zeni.Value >= Price then
Stats.Zeni.Value = Stats.Zeni.Value - Price
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" then
partymembers = {
game.Players:FindFirstChild(myparty.Player1.Value),
game.Players:FindFirstChild(myparty.Player2.Value)
}
end
-- if MyPartyFolder.Player3.Value ~= "No One" then partymembers = {Players:FindFirstChild(MyPartyFolder.Player1.Value), Players:FindFirstChild(MyPartyFolder.Player2.Value), Players:FindFirstChild(MyPartyFolder.Player3.Value) }return end
-- if MyPartyFolder.Player4.Value ~= "No One" then partymembers = {Players:FindFirstChild(MyPartyFolder.Player1.Value), Players:FindFirstChild(MyPartyFolder.Player2.Value), Players:FindFirstChild(MyPartyFolder.Player3.Value), Players:FindFirstChild(MyPartyFolder.Player4.Value) }return end
game.TeleportService:TeleportAsync(10539033270,partymembers)
end
end
},
will i do player3 and player 4 like this? if I wanna take all four player or three players
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" then
partymembers = {
game.Players:FindFirstChild(myparty.Player1.Value),
game.Players:FindFirstChild(myparty.Player2.Value)
}
end
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" and myparty.Player3.Value ~= "" then
partymembers = {
game.Players:FindFirstChild(myparty.Player1.Value),
game.Players:FindFirstChild(myparty.Player2.Value),
game.Players:FindFirstChild(myparty.Player3.Value)
}
end
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" and myparty.Player3.Value ~= "" and myparty.Player4.Value ~= "" then
partymembers = {
game.Players:FindFirstChild(myparty.Player1.Value),
game.Players:FindFirstChild(myparty.Player2.Value),
game.Players:FindFirstChild(myparty.Player3.Value),
game.Players:FindFirstChild(myparty.Player4.Value)
}
end```
This may not help, but what is your Value inside the player?
If you insert a NumberValue, or similar, shouldn’t you be reading MyPartyFolder.Player2.Value.Value to get the actual number?
if Stats.Zeni.Value >= Price then
game.ServerStorage.PlayerData[plr.Name].Stats.GCProgress.Value = 3500 --the time
Stats.Zeni.Value = Stats.Zeni.Value - Price
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" then
partymembers = {
myparty.Player1.Value,
myparty.Player2.Value
}
end
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" and myparty.Player3.Value ~= "" then
partymembers = {
myparty.Player1.Value,
myparty.Player2.Value,
myparty.Player3.Value
}
end
if myparty.Player1.Value ~= "" and myparty.Player2.Value ~= "" and myparty.Player3.Value ~= "" and myparty.Player4.Value ~= "" then
partymembers = {
myparty.Player1.Value,
myparty.Player2.Value,
myparty.Player3.Value,
myparty.Player4.Value
}
end
Services.TeleportService:TeleportAsync(10539033270,partymembers)
end
end```