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

Script working in studio, but not in a game?

Asked by 9 years ago

I have these in Scripts, and the problem is in the Title. Do I need to change them over to LocalScripts?

local sp = script.Parent
local shirt = sp.Parent.Parent.Parent.Parent.Model:WaitForChild("Shirt")
print 'Found Shirt!'
local value = sp.Parent.Parent.Parent.Parent.Model:WaitForChild("ShirtValue")
print 'Found Value!'

function textureChange()
    shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=169494949"
    value.Value = "169494950"
end
sp.MouseButton1Down:connect(textureChange)

1 answer

Log in to vote
0
Answered by
Seenit 80
9 years ago

Usually when a script works in PlaySolo mode but not online means it's meant to be a local script. I recommend changing this script to a local one if it's not already. The reasoning behind this is because PlaySolo runs locally while online has Server scripts and Local Scripts. I'm assuming this is for a text/image button so use local scripts!

Ad

Answer this question