|
| 23 Jun 2013 05:44 PM |
(Relates to my thread - http://www.roblox.com/Forum/ShowPost.aspx?PostID=102452718)
Ok, So I have this "YES" TextButton in a Frame in a GUI.
It works fine in Play Solo mode, but not in the actual online mode.
In the Studio "Play Solo" mode, the "YES" button works fine. But when I go to my place in the actual online mode, the "YES" button doesn't work. I keep clicking it, nothing happens. In Play Solo, When I click the "YES" button, it does what it's supposed to do, teleport to a certain position in the game. (That doesn't happen in the actual online mode)
How do I fix this? |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 05:47 PM |
Bump.
Need it for a game, Thanks. |
|
|
| Report Abuse |
|
|
zakary99
|
  |
| Joined: 19 Jan 2010 |
| Total Posts: 1095 |
|
| |
|
|
| 23 Jun 2013 05:49 PM |
| you might need to put the script you have into a local script if you don't already. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 05:51 PM |
@froggo, thanks, I'll be sure to try that when I get on my laptop again. It's a normal script right now, I'll make it a LocalScript |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 05:51 PM |
- ScreenGui -- TextButton (Yes) Put the script below in here --- Script --Other buttons
plr = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function() char = plr.Character torso = char.Torso torso.CFrame = CFrame.new(game.Workspace.Base.Position) --make sure there's only 1 brick in workspace named "Base" at all times end)
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 05:59 PM |
@Zackary and TheAmazeman
My current script is:
function onClicked() if game.Players.LocalPlayer == nil then return end game.Players.LocalPlayer.Character.Torso.CFrame =CFrame.new(1.5, 58, -15.5) end script.Parent.MouseButton1Click:connect(onClicked)
The script works, but only in Play Solo. Should it be a regular script or LocalScript Also, TheAmazeman, I know where the TextButton and script should be. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 06:03 PM |
You can't use game.Players.LocalPlayer if it's not in a local script, but the code I put will work in a regular script. Just replace
torso.CFrame = CFrame.new(game.Workspace.Base.Position)
with
torso.CFrame = CFrame.new(1.5, 58, -15.5) |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 06:04 PM |
| So I should make my script a LocalScript? |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 06:07 PM |
Up to you, but you can have this work fine
plr = script.Parent.Parent.Parent.Parent script.Parent.MouseButton1Click:connect(function() char = plr.Character torso = char.Torso torso.CFrame = CFrame.new(1.5, 58, -15.5) end) |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 06:08 PM |
Alright, I'll try out both and see if there's any difference.
Thanks. |
|
|
| Report Abuse |
|
|
zakary99
|
  |
| Joined: 19 Jan 2010 |
| Total Posts: 1095 |
|
|
| 26 Jun 2013 05:26 AM |
@TheAmazeMan, LocalPlayer has worked for me in normal code. So that doesn't add up. ~Zak |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 26 Jun 2013 05:29 AM |
| All scripts in Solo are run locally so put it in a Local Script. |
|
|
| Report Abuse |
|
|