Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can you take scores, teams, and items with you from place to place?

Asked by 9 years ago

I have a WWI battleground in a map that I want you to be able to get gear from a base camp in a separate place. I don't know how to make you keep your gear or team, though. Or if that's even possible. If it is, I'd be super grateful to anyone who could tell me how it's possible.

Here's the place teleportation script I've got so far:

PlaceId = 20158067
Part = script.Parent
Players = Game:GetService("Players")

Part.Touched:connect(function(Hit)
Player = Players:GetPlayerFromCharacter(Hit.Parent)
if Player then
Game:GetService("TeleportService"):Teleport(PlaceId, Player.Character)
end
end)

Thinking about it, I could just have it be from the same place if I have to, but it wouldn't be as pretty to try and use separate effects. I'd also like to have the opportunity to add separate battle zones later, but that's not as important as getting this one map to work.

Thanks! -Bubblehead12

0
As a possible sidenote, I would also like to know a site that teaches scripting. I am NOT very good, and I'd like to have a simple start to doing it by myself, so if anyone knows a good site and sees this, feel free to comment please. DiscoStriker 20 — 9y

2 answers

Log in to vote
2
Answered by 9 years ago

No, this is only possible thru data store I believe and only able if they are in the same universe(Excuse me if im wrong about data store, it might also be data persistence) but here

local datastore = game:GetService("DataStoreService"):GetDataStore("DataStoreName")
local values = {"Level", Exp,}

function onjoin(player)
for i = 1, #values do
value = Instance.new("StringValue")
value.Value = datastore:GetAsync(player.Name..values[i])
value.Parent = player
end
end

function onleave(player)
for i = 1, #values do
if player:FindFirstChild(values[i])~= nil
then
datastore:SetAsync(player.Name..values[i], player:FindFirstChild(values[i]).Value)
end

game.Players.PlayerAdded:connect(onjoin)
game.Players.PlayerRemoving:connect(onleave)

Also put a :SetAsync() in the button script to ensure it save when you leave.

Ad
Log in to vote
1
Answered by 9 years ago

wiki.roblox.com

1
Search through free models. Mod them up. BosswalrusTheCoder 88 — 9y
0
Thanks for the tip about the learning, but until I can actually learn (Which'll take a while) I'm stuck with mostly whatever I find in free models. I can't find anything pertaining to what I am looking for exactly. DiscoStriker 20 — 9y
1
I learned from Pig Head on youtube. Then after I him I went on to Friaza Hyuga. Dont do Friaza Hyuga until you learned Pig Head. BosswalrusTheCoder 88 — 9y
1
Well, Friaza Hyuga does intermediate scripting. Idk if you are basic, intermediate or advanced. BosswalrusTheCoder 88 — 9y
View all comments (2 more)
0
Thanks for the extra tips. Once I have a day without responsibilities (next week I think) I'm going to watch AALLLL of them. Also, definitenly basic. DiscoStriker 20 — 9y
0
When you get after intermediate just keep learning basic stuff and intermediate stuff again. There might be stuff you missed. Then just find your own path. BosswalrusTheCoder 88 — 9y

Answer this question