generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: HELP!

Previous Thread :: Next Thread 
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
11 May 2016 12:07 PM
So basically this gets copied into PlayerGui when a plr enters. It's a script(tell me if its important to change it to localscript) in a stringvalue.. the string value gets connected to the custom chat i made...it dispalys the stringvalue correctly.. but it doesen't set the string value to rank you are:


local vip = 410430003
local premium = 411796444

while true do
game.Players.PlayerAdded:connect(function(player)

if script.Parent.Value ~= "VIP" and "PLAYER" and "PREMIUM" and "DEV" and "OWNER" then

-- Check for DEV and OWNER
if game.Players.LocalPlayer.Name == "TjazBuilder" then
script.Parent.Value = "OWNER"
end

if game.Players.LocalPlayer.Name == "Dolanson" then
script.Parent.Value = "DEV"
end



if game:GetService("GamePassService"):PlayerHasPass(player, vip) then -- HAS VIP GAMEPASS
script.Parent.Value = "VIP"
end


if game:GetService("GamePassService"):PlayerHasPass(player, premium) then -- HAS PREMIUM GAMEPASS
script.Parent.Value = "PREMIUM"
end

if game:GetService("GamePassService"):PlayerHasPass(player, vip) then
if game:GetService("GamePassService"):PlayerHasPass(player, premium) then
script.Parent.Value = "PREMIUM"
end
end


else
script.Parent.Value = "PLAYER"
end
end)
wait(.1)
end



Please tell me!
Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
11 May 2016 03:06 PM
You say the script gets copied into PlayerGui?

script.Parent.Value = "OWNER"

The problem here is that the script's parent is PlayerGui, not the string value, and it will never set the rank to stringValue.Value as a result

script.Parent.stringValue.Value = "OWNER"

Whatever your string value is called, will go where stringValue is.

If there are other errors, I might not be immediately seeing them.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
11 May 2016 11:47 PM
I dont get it... The scripts are in the string value and they get cloned to playergui...
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
12 May 2016 12:06 AM
he just misinterpreted, ignore him

and also please do proper indentation, it helps us help you faster in a lot of cases

this is inside of a stringvalue, and the stringvalue and its children are copied over to playergui?

Change it to a localscript. They can run from playergui.

local Player = game:GetService("Players").LocalPlayer
local Devs = {["TjazBuilder"]=true,
["Dolanson"]=true}
local Passes = {["VIP"] = 41043003,
["PREMIUM"] = 411796444}

for X, Pass in next, Passes do
if game:GetService("GamePassService"):PlayerHasPass(Player, Pass) then
script.Parent.Value = X
end
end
if Devs[Player.Name] then
script.Parent.Value = "DEV"
end
if Player.UserId == game.CreatorId then
script.Parent.Value = "Owner"
end

This will basically allow you to easily change the dev and pass information. Just make the first item in the Pass table the least important and the last the most important.
After it checks for the pass, it will check to see if the player is a dev. Make sure that they all follow the =true pattern.
After all that, if your userid is the creator's, it will recognize you as the owner.
Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
12 May 2016 04:07 AM
Ignore her, but that's not the issue here. I misread his post and skimmed over the part where the script is in the stringValue. Also, indentation is definitely a plus.

That seems silly to me and I never see that. Usually the script is outside of the value, and the script holds the value's location in a variable.
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
12 May 2016 04:51 AM
When it comes to solving other people's problems, it's all about keeping an open mind.

Usually because their thoughts can't get through if you leave the door shut.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
12 May 2016 06:23 AM
... Im just going to put scripts outside the stringvalue..
Report Abuse
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
12 May 2016 07:18 AM
maybe try...
if script.Parent.Value ~= "VIP" and script.Parent.Value ~= "PLAYER" and script.Parent.Value ~="PREMIUM" --etc...

I don't know if it matters, to repeat the script.Parent.Value for every 'and' but if nothing else works you may as well try it.
Report Abuse
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
12 May 2016 07:28 AM
Dats a bit noobish mayun.. Just make a table with all the players and there stats/ranks. Then make another table that relates to that and use that as a tag. And just compare the user and tables.


#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
12 May 2016 12:15 PM
uhh nothing worked
Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
12 May 2016 01:11 PM
Jammer, it isn't about an open mind. Programming has correct ways of doing things.

Generally speaking, scripts shouldn't be placed in individual values. It works, but there is a level of readability that comes with expectations, and here's why:

Anyways, I went ahead and I had a go at the original code because the original poster hasn't gotten this fixed yet. I came up with this code. I created a script, not a local script, and placed it into game.Workspace. Then, I put a stringValue with a default value of "" into StarterPack, where it should go.

According to the prints, this code works. Let me know if it needs adjusting, sometimes bugs can pop up when moving code on forums. Also, someone let me know how to indent on the forums at some point please.

local vip = 410430003
local premium = 411796444

function rankCheck(player)
local player = game.Players:findFirstChild(player.Name)
player:WaitForChild("Backpack")
local value = player.Backpack.rank
if value.Value ~= nil then
if player.Name == "TjazBuilder" then
value.Value = "OWNER"
print("You are the owner, " .. player.Name)
elseif player.Name == "Dolanson" then
value.Value = "DEV"
print("You are a specific dev, " .. player.Name)
elseif game:GetService("GamePassService"):PlayerHasPass(player, vip) then
value.Value = "VIP"
print("You are VIP, " .. player.Name)
elseif game:GetService("GamePassService"):PlayerHasPass(player, premium) then
value.Value = "PREMIUM"
print("You have premium status! " .. player.Name)
else
value.Value = "PLAYER"
print("Don't be a pleb, buy something please, " .. player.Name)
end
end
end

game.Players.PlayerAdded:connect(rankCheck)


Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
12 May 2016 03:27 PM
Also note if premium is a higher rank than VIP, then just rearrange the function's code for that.

If the GUI connects to the stringValue, point to the value within the GUI script, don't just cram it all into one area, that's going to cause issues, namely what we started with.

That's the only thing I spotted that I forgot to include, so sorry for the double post.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
13 May 2016 02:16 PM
I tried this idea but.. it still shows an empty [] space in the chat one.. beacuse the stringvalue doesen't get edited at all!
Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
13 May 2016 02:56 PM
In my studio, when I test and check the value in explorer, I see the value is edited. If it is not displaying in the GUI, then that might be an error in the GUI script. Perhaps if you moved the string value to a different location like my idea suggested, you may need to edit the GUI script to fix that issue.

But I can certainly see the value is changing in my studio. I've had it check for my name and set to OWNER, and when not my name it sets me to PLAYER.
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
13 May 2016 03:14 PM
The weird fact is:
- It doesen't show any errors!
- The StringValue doesen't get edited at all!
Report Abuse
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
13 May 2016 03:20 PM
1) Is it a local script?


#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end
Report Abuse
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
13 May 2016 03:22 PM
2) Is filtering enabled. 3) Are you trying to see it from the server?


#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
13 May 2016 03:39 PM
It's a script trying to communicate to a stringvalue in player's backpack.. the string value doesent get edited with no errors
Report Abuse
ilovebuilding125 is not online. ilovebuilding125
Joined: 12 Jun 2009
Total Posts: 1053
13 May 2016 06:08 PM
See, I put the code I pasted into a script in the workspace and a stringvalue in StarterPack to be distributed to players and it edits the value in the player's backpack. I can fully provide screenshots, this code works.

Something else OP is doing is causing more issues.
Report Abuse
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
13 May 2016 10:46 PM
Make a remote event and change it from the server just to be safe.
Make this in the server script..

#code
local Create = LoadLibrary("RbxUtility").Create
local REvent = Create("RemoteEvent"){
Parent = game.Workspace;
Name = "ThatEventTho";
}
REvent.OnServerEvent:connect(function(plr,obj,prop,value)
obj[prop] = value;
end)


And have the local script change things like this..

#code
local Event = game.Workspace:WaitForChild("ThatEventTho")
Event:FireServer(script.Parent.StringValue --[[ or whatever ]], "Value", "NewValue" --[[waht you want it to become]])


#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end
Report Abuse
TjazBuilder is not online. TjazBuilder
Joined: 27 Sep 2013
Total Posts: 845
14 May 2016 03:01 AM
nvm! it works now!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image