|
| 16 Aug 2015 09:34 AM |
I'm working on an RPG but I can't get the battle script (local script) to connect to another script that makes the game realize you aren't in a battle anymore, help?
local player = game.Players.LocalPlayer local gui = script.Parent local othergui = gui:WaitForChild("Other") local inbattle = player:WaitForChild("InBattle") local other = inbattle:WaitForChild("OtherRBLXN") local event = inbattle:WaitForChild("RemoteEvent") local rblxnimages = {"rbxasset://textures\\GunCursor.png","rbxasset://textures\\GunCursor.png","rbxasset://textures\\GunCursor.png"} --Changed to gun cursor so peeps don't steal images
inbattle.Changed:connect(function() gui.Visible = inbattle.Value event:FireServer(player,"RunAway","You ran away") othergui.Image = rblxnimages[other.Value] end) |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:35 AM |
Forgot the other script:
local inbattle = script.Parent local player = inbattle.Parent local event = inbattle:WaitForChild("RemoteEvent")
event.OnServerEvent:connect(function() game.Workspace.BasePlate.BrickColor = BrickColor.Random() end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Aug 2015 09:39 AM |
| player gets automatically added as the first argument, you don't need to add it yourself. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 09:40 AM |
| If you're testing via Test > Test Solo, this won't work since everything is treated as on the server. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:40 AM |
| My problem is that the server script doesn't know that the local script is connecting to it |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:41 AM |
| on the actual game it will work? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:41 AM |
@agent
remotes work fine in play solo |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:44 AM |
| Say Dermon, didn't I see you when I needed help with my sign script? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 09:49 AM |
| doesn't work play solo or online |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Aug 2015 09:51 AM |
If your values are being created by the server, local scripts can't access it If fe |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 16 Aug 2015 10:26 AM |
"@agent remotes work fine in play solo"
They must have updated. It doesn't make sense that they work in Solo ... |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 10:54 AM |
The server script doesn't run at all. Scripts don't run under the player. Also, put your RemoteEvent in ReplicatedStorage and use only one. You can already differentiate each player. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2015 11:04 AM |
| OHHHHHHHH!!! THATS HOW I DO IT |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2015 11:18 AM |
| why wouldn't remoteevents work in play solo? |
|
|
| Report Abuse |
|
|
| |
|