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: Works in Studio, not online

Previous Thread :: Next Thread 
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
03 Mar 2015 10:07 PM
The following script works as intended in Studio test mode, but it won't work online.

Shirt = script.Parent.Parent.Shirt
ItemID = script.Parent.Parent.Shirtid.Value
Shirt.ShirtTemplate = ItemID
Cost = script.Parent.Parent.ShirtCost.Value
ItemName = script.Parent.Parent.ShirtItem.Value

script.Parent.Parent.Name = ""

local clickDetector = Instance.new("ClickDetector", script.Parent)
clickDetector.Name = "clicker"

script.Parent.clicker.MouseHoverEnter:connect(function(Player)
script.Parent.Parent.Name = ItemName..": $"..Cost
end)

script.Parent.clicker.MouseHoverLeave:connect(function(Player)
script.Parent.Parent.Name = ""
end)

local function onMouseClick(player)
if player.leaderstats.Money.Value >= Cost then

local Player = player
repeat wait() until Player.Character
local Char = Player.Character
if Char.shirt.ShirtTemplate ~= ItemID then
player.leaderstats.Money.Value = player.leaderstats.Money.Value - Cost
Char.shirt.ShirtTemplate = ItemID
end


end
end
clickDetector.MouseClick:connect(onMouseClick)


When in studio, it changes the player's shirt.
When in online mode, all it does is deduct money. A few of my friends have noticed that when they rejoin, they see anyone who bought the shirt as someone who is wearing it, but the shirts don't register until someone restarts.\

How do I fix this glitch?
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 04:47 AM
Bump
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
04 Mar 2015 04:56 AM
Well you're coding it like it's a local script...
Also what if the player doesn't have a shirt on it'll break your script. :o
You need to make it delete shirt if found and instance a new one. :P
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 05:10 AM
I'm going to try that now. :)
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 05:16 AM
It didn't work. :/
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
04 Mar 2015 05:17 AM
skimmed OP...and what...click detectors have a MouseClick event lol
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
04 Mar 2015 05:17 AM
oh nvm didn't read that right
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 05:20 AM
What's weird is that it works in Studio mode just fine.
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 05:23 AM
Also, it appears that it does run the script, but when in the real game, it won't show you the updated clothes. If someone joins after you buy it, they see the new clothes, but for some reason the game is just not updating for any current player's.
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 05:27 AM
It even works in build mode.
Report Abuse
jcpd910 is not online. jcpd910
Joined: 18 Jul 2011
Total Posts: 70
04 Mar 2015 09:09 AM
Bump
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